1 // first application is for the 'validation' button in the topmenu
2 // if the subject query is non empty, then we turn on the subject button
3 // that is provided through button_domid
10 var ValidateButton = Plugin.extend({
12 init: function(options, element) {
13 this._super(options, element);
14 this.listen_query(options.query_uuid);
18 // Could be the default in parent
19 on_query_in_progress: function() {
23 // we have received at least one answer: we'll do something
24 on_new_record: function (record) {
25 // we only need to act on the first record
26 if (this.triggered) return;
27 if (debug) messages.debug("validatebutton.on_query_done - turning on "+this.options.button_domid);
28 $('#'+this.options.button_domid).removeClass('disabled');
32 // for reference only, since there is nothing we need to do at this point
33 on_query_done: function() {
34 if (!this.triggered) this.unspin();
38 $.plugin('ValidateButton', ValidateButton);