You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
692 B

  1. !function(e){e.add("module","magicquery",{init:function(e,t){this.app=e,this.response=e.response;var s={url:!1};this.context=t,this.params=t.getParams(s),this.$element=t.getElement()},start:function(){this.$element.on("click.kube.magicquery",this._send.bind(this))},stop:function(){this._enable(),this.$element.off(".kube.magicquery")},_disable:function(){this.$element.attr("disabled",!0)},_enable:function(){this.$element.removeAttr("disabled")},_send:function(t){t.preventDefault(),this._disable(),e.ajax.post({url:this.params.url,success:this._parse.bind(this)})},_parse:function(e){this._enable();var t=this.response.parse(e);t&&this.app.broadcast("magicquery.success",this,t)}})}(Kube);