diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-06-07 13:04:50 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-06-07 13:04:50 -0400 |
commit | b13c5a97290c04601b8c069413fef584da018928 (patch) | |
tree | 1bc3116f33018ba9e543f257aaed47ce8d97e63a | |
parent | e10517db8efe907cadb805a05b4c948a4e5264d5 (diff) | |
download | askbot-b13c5a97290c04601b8c069413fef584da018928.tar.gz askbot-b13c5a97290c04601b8c069413fef584da018928.tar.bz2 askbot-b13c5a97290c04601b8c069413fef584da018928.zip |
broken commit. started working on editable category tree
-rw-r--r-- | askbot/skins/common/media/js/post.js | 27 | ||||
-rw-r--r-- | askbot/skins/common/media/js/utils.js | 4 |
2 files changed, 27 insertions, 4 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js index 7a21a46b..40773009 100644 --- a/askbot/skins/common/media/js/post.js +++ b/askbot/skins/common/media/js/post.js @@ -2715,6 +2715,27 @@ TagEditor.prototype.decorate = function(element) { }); }; +var Category = function() { + SelectBoxItem.call(this); + tihs._is_editable = false; +}; +inherits(Category, SelectBoxItem); + +Category.prototype.decorate = function(element) { + this.superClass_.decorate.call(this, element); +}; + +/** + * @constructor + * SelectBox subclass to create/edit/delete + * categories + */ +var CategorySelectBox = function() { + SelectBox.call(this); + this._item_class = Category; +}; +inherits(CategorySelectBox, SelectBox); + var CategorySelector = function() { WrappedElement.call(this); this._data = null; @@ -2810,19 +2831,19 @@ CategorySelector.prototype.decorate = function(element) { this._element = element; this._selectors = []; - var selector0 = new SelectBox(); + var selector0 = new CategorySelectBox(); selector0.decorate(element.find('.cat-col-0')); selector0.setSelectHandler(this.getSelectHandler(0)); this.maybeAddEditButton(selector0); this._selectors.push(selector0); - var selector1 = new SelectBox(); + var selector1 = new CategorySelectBox(); selector1.decorate(element.find('.cat-col-1')); selector1.setSelectHandler(this.getSelectHandler(1)); this.maybeAddEditButton(selector1); this._selectors.push(selector1) - var selector2 = new SelectBox(); + var selector2 = new CategorySelectBox(); selector2.decorate(element.find('.cat-col-2')); selector2.setSelectHandler(this.getSelectHandler(2)); this.maybeAddEditButton(selector2); diff --git a/askbot/skins/common/media/js/utils.js b/askbot/skins/common/media/js/utils.js index fcb22197..b4d08b2c 100644 --- a/askbot/skins/common/media/js/utils.js +++ b/askbot/skins/common/media/js/utils.js @@ -936,7 +936,9 @@ SelectBox.prototype.getItem = function(id){ } return undefined; }; - +/** + * this method sets css class to the item's DOM element + */ SelectBox.prototype.setItemClass = function(id, css_class) { this.getItem(id).getElement().addClass(css_class); }; |