From 88c817318430e8ab6557c78215d4f3917f7d1521 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sat, 25 May 2013 06:38:32 -0400 Subject: fixed some general js coding issues in the Groups dropdown code --- askbot/media/js/utils.js | 140 ++++++++++++++---------------- askbot/templates/meta/bottom_scripts.html | 3 - 2 files changed, 63 insertions(+), 80 deletions(-) diff --git a/askbot/media/js/utils.js b/askbot/media/js/utils.js index 0380e6fe..b13c21a3 100644 --- a/askbot/media/js/utils.js +++ b/askbot/media/js/utils.js @@ -2011,8 +2011,18 @@ SelectBox.prototype.createDom = function() { var GroupDropdown = function(groups){ WrappedElement.call(this); this._group_list = groups; +}; +inherits(GroupDropdown, WrappedElement); + +GroupDropdown.prototype.createDom = function(){ + this._element = this.makeElement('ul'); + this._element.attr('class', 'dropdown-menu'); + this._element.attr('id', 'groups-dropdown'); + this._element.attr('role', 'menu'); + this._element.attr('aria-labelledby', 'navGroups'); + this._input_box = new TippedInput(); - this._input_box.setInstruction('group name'); + this._input_box.setInstruction(gettext('group name')); this._input_box.createDom(); this._input_box_element = this._input_box.getElement(); this._input_box_element.attr('class', 'group-name'); @@ -2021,60 +2031,36 @@ var GroupDropdown = function(groups){ this._add_link.attr('href', '#'); this._add_link.attr('class', 'group-name'); this._add_link.text(gettext('add new group')); -}; -inherits(GroupDropdown, WrappedElement); -GroupDropdown.prototype.createDom = function(){ - this._element = this.makeElement('ul'); - this._element.attr('class', 'dropdown-menu'); - this._element.attr('id', 'groups-dropdown'); - this._element.attr('role', 'menu'); - this._element.attr('aria-labelledby', 'navGroups'); - - for (i=0; i