Permalink
Browse files

fix(js): ui bindings now wait for system init event to fire

UI element bindings should occur on system init event to ensure that
DOM is ready and all required libraries are loaded.

This moves "add-friend" and "remove-friend" menu item toggling
registration
to init,system callback rather than performing at runtime.
  • Loading branch information...
hypeJunction committed Apr 1, 2016
1 parent 9d9ca1b commit 5794e0275629e14830e6c464460056c4bc6f5bd3
Showing with 2 additions and 1 deletion.
  1. +2 −1 js/lib/ui.js
View
@@ -41,6 +41,8 @@ elgg.ui.init = function () {
$(elementId).addClass('elgg-state-highlight');
elgg.ui.initDatePicker();
+
+ elgg.ui.registerTogglableMenuItems('add-friend', 'remove-friend');
};
/**
@@ -391,4 +393,3 @@ elgg.ui.initAccessInputs = function () {
elgg.register_hook_handler('init', 'system', elgg.ui.init);
elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler);
-elgg.ui.registerTogglableMenuItems('add-friend', 'remove-friend');

0 comments on commit 5794e02

Please sign in to comment.