From 40cf6b3ccb763d3bc0e4fdcd360175ab851ab3df Mon Sep 17 00:00:00 2001 From: Big Bad Waffle Date: Wed, 17 Oct 2018 07:19:12 +0000 Subject: [PATCH] Revert "fixes #934" This reverts commit 335763da4c686cc6cf735f006e92df144d0982bd --- helpers/passives/client/ui/uiBase.js | 20 ++++++++++---------- src/client/ui/uiBase.js | 9 ++------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/helpers/passives/client/ui/uiBase.js b/helpers/passives/client/ui/uiBase.js index cc3b340c..cfe8edb1 100644 --- a/helpers/passives/client/ui/uiBase.js +++ b/helpers/passives/client/ui/uiBase.js @@ -14,7 +14,7 @@ define([ eventCallbacks: {}, render: function () { - let container = '.ui-container'; + var container = '.ui-container'; if (this.container) container += ' > ' + this.container; @@ -50,13 +50,13 @@ define([ }, on: function (el, event, callback) { - if (typeof (el) === 'string') + if (typeof (el) == 'string') el = this.find(el); else el = $(el); el.on(event, function (e) { - let args = [].slice.call(arguments, 1); + var args = [].slice.call(arguments, 1); args.splice(0, 0, event); callback.apply(null, [...args, e]); @@ -76,11 +76,11 @@ define([ this.centeredX = x; this.centeredY = y; - let el = this.el; - let pat = el.parent(); + var el = this.el; + var pat = el.parent(); - let posX = ~~((pat.width() / 2) - (el.width() / 2)) - 10; - let posY = ~~((pat.height() / 2) - (el.height() / 2)) - 10; + var posX = ~~((pat.width() / 2) - (el.width() / 2)) - 10; + var posY = ~~((pat.height() / 2) - (el.height() / 2)) - 10; el.css('position', 'absolute'); if (x) @@ -119,15 +119,15 @@ define([ }, setDisabled: function (isDisabled) { - this.el.removeClass('disabled'); + this.el.removeClass('disabled') if (isDisabled) this.el.addClass('disabled'); }, onEvent: function (event, callback) { - let list = this.eventCallbacks[event] || (this.eventCallbacks[event] = []); - let eventCallback = events.on(event, callback); + var list = this.eventCallbacks[event] || (this.eventCallbacks[event] = []); + var eventCallback = events.on(event, callback); list.push(eventCallback); return eventCallback; diff --git a/src/client/ui/uiBase.js b/src/client/ui/uiBase.js index 7292a809..04ad10d5 100644 --- a/src/client/ui/uiBase.js +++ b/src/client/ui/uiBase.js @@ -89,13 +89,8 @@ define([ el.css('top', posY); }, show: function () { - if (this.modal) { - $('.modal').toArray().forEach(u => { - let ui = $(u).data('ui'); - if (ui.shown) - ui.hide(); - }); - } + if (this.modal) + $('.modal').hide(); this.shown = true; this.el.show();