X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquery_editor%2Fstatic%2Fjs%2Fquery_editor.js;h=7338b69b157cd31bd861538ff32719bfdceed32b;hb=d384e4b10bf9ba67f610bef72cf0e5b2dd747baf;hp=90d113dc9a23b2058c041f549b6da93263f00df3;hpb=8c864591e6ddfed6ca56b529c779dfa4499829da;p=unfold.git diff --git a/plugins/query_editor/static/js/query_editor.js b/plugins/query_editor/static/js/query_editor.js index 90d113dc..7338b69b 100644 --- a/plugins/query_editor/static/js/query_editor.js +++ b/plugins/query_editor/static/js/query_editor.js @@ -41,6 +41,10 @@ init: function(options, element) { this._super(options, element); this.listen_query(options.query_uuid); + // this one is the complete list of resources + // and will be bound to callbacks like on_all_new_record + this.listen_query(options.query_all_uuid, 'all'); + this.elts('queryeditor-auto-filter').change(this.event_filter_added('=')); this.elts('queryeditor-filter').change(this.event_filter_added('=')); @@ -56,7 +60,7 @@ // XXX Why isn't it done statically ? var nCloneTh = document.createElement( 'th' ); var nCloneTd = document.createElement( 'td' ); - nCloneTd.innerHTML = ""; + nCloneTd.innerHTML = ""; //nCloneTd.innerHTML = ''; nCloneTh.innerHTML = 'Info'; nCloneTd.className = "center"; @@ -93,16 +97,16 @@ this.elmt('table tbody td span').on('click', function() { var nTr = this.parentNode.parentNode; // use jQuery UI instead of images to keep a common UI - // class="ui-icon treeclick ui-icon-triangle-1-s tree-minus" - // East oriented Triangle class="ui-icon-triangle-1-e" - // South oriented Triangle class="ui-icon-triangle-1-s" + // class="glyphicon glyphicon-chevron-down treeclick tree-minus" + // East oriented Triangle class="glyphicon-chevron-right" + // South oriented Triangle class="glyphicon-chevron-down" - if (this.className=="ui-icon ui-icon-triangle-1-e") { - this.removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s"); + if (this.hasClass("glyphicon-chevron-right")) { + this.removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down"); // XXX ?????? metaTable.fnOpen(nTr, this.fnFormatDetails(metaTable, nTr, self.options.plugin_uuid+'_div'), 'details' ); } else { - this.removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e"); + this.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right"); metaTable.fnClose(nTr); } }); @@ -171,7 +175,6 @@ on_field_added: function(field) { - console.log("on_field_added : "+field); this.check_field(field); }, @@ -186,10 +189,9 @@ //console.log("Query_Editor: query_done!"); //console.log(this.availableTags); }, - on_new_record: function(record) + /* Autocomplete based on query_all to get all the fields, where query get only the fields selected */ + on_all_new_record: function(record) { - //console.log("Query_Editor: new_record!"); - //console.log(record); availableTags = this.availableTags; jQuery.each(record,function(key,value){ value = unfold.get_value(value);