diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-13 10:11:42 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-13 10:11:42 -0400 |
commit | c6a8d0bfaf96c4275de553baafa883fabd0f7728 (patch) | |
tree | c470887d3c7928d6b70f6617a53d8a06667e4f0b | |
parent | 62de287fce900930101dc9c878d497d932ade740 (diff) | |
download | askbot-c6a8d0bfaf96c4275de553baafa883fabd0f7728.tar.gz askbot-c6a8d0bfaf96c4275de553baafa883fabd0f7728.tar.bz2 askbot-c6a8d0bfaf96c4275de553baafa883fabd0f7728.zip |
started work on supporting limited max-width on images
-rw-r--r-- | askbot/media/js/utils.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/askbot/media/js/utils.js b/askbot/media/js/utils.js index c0f7ca2f..b359fa5d 100644 --- a/askbot/media/js/utils.js +++ b/askbot/media/js/utils.js @@ -502,6 +502,27 @@ WaitIcon.prototype.createDom = function() { }; /** + * makes images never take more spaces then they can take + */ +var LimitedWidthImage = function(sizeRules) { + this._sizeRules = sizeRules; + WrappedElement.call(this); +}; +inherits(LimitedWidthImage, WrappedElement); + +LimitedWidthImage.prototype.autoResize = function() { + var winWidth = $(window).width(); + //@todo: do the actual resizing job here +}; + +LimitedWidthImage.prototype.decorate = function(element) { + this._element = element; + this.autoResize(); + var me = this; + $(window).resize(function() { me.autoResize(); }); +}; + +/** * @contsructor * a form helper that disables submit button * after it is submitted the first time |