X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fapply%2Fstatic%2Fjs%2Fapply.js;h=b94fcd6eec934d72bddccb56a63c3f9489ad3910;hb=2696c755ef27a62406f190412eb8736393682bac;hp=efc93450051a745f32758daf3e8b6518b6f594c6;hpb=ee9ed4a2d0300eeb7557ef94d70a7195962ea8ab;p=unfold.git diff --git a/plugins/apply/static/js/apply.js b/plugins/apply/static/js/apply.js index efc93450..b94fcd6e 100644 --- a/plugins/apply/static/js/apply.js +++ b/plugins/apply/static/js/apply.js @@ -46,10 +46,10 @@ bAutoWidth: true, }); - //this.elmt('update').click(this, this.do_ok); - //this.elmt('refresh').click(this, this.do_cancel); + this.elmt('close').click(this, this.do_close); + //this.elmt('apply_cancel').click(this, this.do_cancel); - this.elmt('apply').on('shown.bs.modal', function() { + this.elmt('apply__window').on('shown.bs.modal', function() { self.do_update(); }) @@ -80,7 +80,6 @@ clear: function() { - }, find_row: function(value) @@ -98,7 +97,7 @@ if (cur_value[0] == '{') { cur_value = JSON.parse(cur_value); - return manifold._record_equals(cur_value, value, object_key);_ + return manifold._record_equals(cur_value, value, object_key); } else { return (cur_value == value); } @@ -131,11 +130,13 @@ }, - do_ok: function(e) + do_close: function(e) { - throw 'queryupdater.do_reset Not implemented'; + var self = e.data; + self.table.fnClearTable(); }, + // Not used today do_cancel: function(e) { throw 'queryupdater.do_clear_annotations Not implemented'; @@ -344,11 +345,12 @@ // XXX how do we handle status reset ? // Jordan : I don't understand this. I added this test otherwise we have string = ""..."" double quoted twice. - if (typeof(data.value) !== "string") - data.value = JSON.stringify(data.value); data.selected_resources = this.selected_resources; row = this.find_row(data.value); - newline = [action, data.key, data.value, msg, button]; + if (typeof(data.value) !== "string") + newline = [action, data.key, JSON.stringify(data.value), msg, button]; + else + newline = [action, data.key, data.value, msg, button]; if (!row) { // XXX second parameter refresh = false can improve performance. todo in querytable also this.table.fnAddData(newline);