summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-08-13 10:11:42 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-08-13 10:11:42 -0400
commitc6a8d0bfaf96c4275de553baafa883fabd0f7728 (patch)
treec470887d3c7928d6b70f6617a53d8a06667e4f0b
parent62de287fce900930101dc9c878d497d932ade740 (diff)
downloadaskbot-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.js21
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