diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-12-11 13:03:26 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-12-11 13:03:26 -0300 |
commit | cdee216f38b3473fcde26fafc6b0df578a782df9 (patch) | |
tree | 79d11821ec1c3008f0e33b4d54756170855c4372 /askbot/media/js/utils.js | |
parent | 122b2e0628fbf3f38d7c7136af7e3fce6beedbdb (diff) | |
download | askbot-cdee216f38b3473fcde26fafc6b0df578a782df9.tar.gz askbot-cdee216f38b3473fcde26fafc6b0df578a782df9.tar.bz2 askbot-cdee216f38b3473fcde26fafc6b0df578a782df9.zip |
added a spinner image to the search menu
Diffstat (limited to 'askbot/media/js/utils.js')
-rw-r--r-- | askbot/media/js/utils.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/askbot/media/js/utils.js b/askbot/media/js/utils.js index cf748ee6..e9ae4dd2 100644 --- a/askbot/media/js/utils.js +++ b/askbot/media/js/utils.js @@ -382,6 +382,45 @@ WrappedElement.prototype.dispose = function(){ this._in_document = false; }; +/** + * @constructor + * a loader + */ +var WaitIcon = function() { + WrappedElement.call(this); + this._isVisible = false; +}; +inherits(WaitIcon, WrappedElement); + +WaitIcon.prototype.setVisible = function(isVisible) { + this._isVisible = isVisible; + if (this._element) { + if (this._isVisible === true) { + this._element.show(); + } else { + this._element.hide(); + } + } +}; + +WaitIcon.prototype.hide = function() { + this.setVisible(false); +}; + +WaitIcon.prototype.show = function() { + this.setVisible(true); +}; + +WaitIcon.prototype.createDom = function() { + var box = this.makeElement('div'); + box.addClass('wait-icon-box'); + this._element = box; + var img = this.makeElement('img'); + img.attr('src', mediaUrl('media/images/ajax-loader.gif')); + box.append(img); + this.setVisible(this._isVisible); +}; + /** * @contsructor * a form helper that disables submit button |