summaryrefslogtreecommitdiff
path: root/web-ui/app/js/user_settings
diff options
context:
space:
mode:
authorJefferson Stachelski <jeffhsta@riseup.net>2015-12-03 20:56:16 -0200
committerPixelated <pixelated@pix-poa-1>2015-12-03 21:16:58 -0200
commit7524cb21facf3d739d29e312ffe85bda7377f261 (patch)
tree9bb2cd82e8a91bae7bc2198915eb198aff5f89a7 /web-ui/app/js/user_settings
parent122586bcb637d4bfdbbd6130dc1cf8e0d496cef5 (diff)
Issue #411 - Did some refactores [Gil/Jeff]
Diffstat (limited to 'web-ui/app/js/user_settings')
-rw-r--r--web-ui/app/js/user_settings/ui/user_settings_box.js12
-rw-r--r--web-ui/app/js/user_settings/ui/user_settings_icon.js9
2 files changed, 8 insertions, 13 deletions
diff --git a/web-ui/app/js/user_settings/ui/user_settings_box.js b/web-ui/app/js/user_settings/ui/user_settings_box.js
index 2bc291f9..ece46c49 100644
--- a/web-ui/app/js/user_settings/ui/user_settings_box.js
+++ b/web-ui/app/js/user_settings/ui/user_settings_box.js
@@ -20,22 +20,12 @@ define(
'features',
'views/templates',
'page/events',
- 'views/i18n',
'helpers/monitored_ajax'
- ], function (defineComponent, features, templates, events, i18n, monitoredAjax) {
+ ], function (defineComponent, features, templates, events, monitoredAjax) {
'use strict';
return defineComponent(function () {
- this.create = function(parentElement) {
- parentElement;
-
- var component = new this.consructor();
- component.initialize(html, recipient);
- component.attr.recipient = recipient;
- return component;
- };
-
this.defaultAttrs({
close: '#user-settings-close'
});
diff --git a/web-ui/app/js/user_settings/ui/user_settings_icon.js b/web-ui/app/js/user_settings/ui/user_settings_icon.js
index 64a42127..9471b0f4 100644
--- a/web-ui/app/js/user_settings/ui/user_settings_icon.js
+++ b/web-ui/app/js/user_settings/ui/user_settings_icon.js
@@ -33,7 +33,7 @@ define(
};
this.toggleUserSettingsBox = function() {
- if(this.attr.userSettingsBox.children().length == 0) {
+ if(this.attr.userSettingsBox.children().length === 0) {
var div = $('<div>');
$(this.attr.userSettingsBox).append(div);
userSettingsBox.attachTo(div);
@@ -43,9 +43,14 @@ define(
}
};
+ this.triggerToggleUserSettingsBox = function() {
+ this.trigger(document, events.ui.userSettingsBox.toggle);
+ };
+
this.after('initialize', function () {
this.render();
- this.on('click', this.toggleUserSettingsBox);
+ this.on('click', this.triggerToggleUserSettingsBox);
+ this.on(document, events.ui.userSettingsBox.toggle, this.toggleUserSettingsBox);
});
});
});