diff --git a/src/pat/depends/depends.js b/src/pat/depends/depends.js index 3aeaddc20..1151d8090 100644 --- a/src/pat/depends/depends.js +++ b/src/pat/depends/depends.js @@ -45,14 +45,11 @@ define([ log.error("Invalid condition: " + e.message, slave); return; } - state=handler.evaluate(); switch (options.action) { case "show": - if (state) - this.show(); - else - this.hide(); + utils.hideOrShow($el, state, options, this.name); + this.updateModal(); break; case "enable": if (state) @@ -62,10 +59,12 @@ define([ break; case "both": if (state) { - this.show(); + utils.hideOrShow($el, state, options, this.name); + this.updateModal(); this.enable(); } else { - this.hide(); + utils.hideOrShow($el, state, options, this.name); + this.updateModal(); this.disable(); } break; @@ -112,16 +111,6 @@ define([ } }, - show: function () { - this.$el.show(); - this.updateModal(); - }, - - hide: function () { - this.$el.hide(); - this.updateModal(); - }, - enable: function() { if (this.$el.is(":input")) this.$el[0].disabled=null;