resize listener

This commit is contained in:
James Campos 2011-05-17 02:14:28 -07:00
parent d50b7034b8
commit 03e37241ab
2 changed files with 17 additions and 3 deletions

View File

@ -2122,7 +2122,8 @@
init: function() {
g.callbacks.push(imgExpand.cb.node);
imgExpand.dialog();
return $.addStyle("body.fitheight img[md5] + img { max-height: " + d.body.clientHeight + "px }");
$.bind(window, 'resize', imgExpand.resize);
return imgExpand.resize();
},
cb: {
node: function(root) {
@ -2225,6 +2226,14 @@
$.bind($('input', controls), 'click', imgExpand.cb.all);
delform = $('form[name=delform]');
return $.prepend(delform, controls);
},
resize: function(e) {
var style;
if (style = $('style[media=chan]', d.head)) {
$.rm(style);
}
style = $.addStyle("body.fitheight img[md5] + img { max-height: " + d.body.clientHeight + "px }");
return style.media = 'chan';
}
};
NAMESPACE = 'AEOS.4chan_x.';

View File

@ -1637,8 +1637,8 @@ imgExpand =
init: ->
g.callbacks.push imgExpand.cb.node
imgExpand.dialog()
#FIXME add a resize listener
$.addStyle "body.fitheight img[md5] + img { max-height: #{d.body.clientHeight}px }"
$.bind window, 'resize', imgExpand.resize
imgExpand.resize()
cb:
node: (root) ->
@ -1711,6 +1711,11 @@ imgExpand =
delform = $ 'form[name=delform]'
$.prepend delform, controls
resize: (e) ->
$.rm style if style = $ 'style[media=chan]', d.head
style = $.addStyle "body.fitheight img[md5] + img { max-height: #{d.body.clientHeight}px }"
style.media = 'chan'
#main
NAMESPACE = 'AEOS.4chan_x.'
g =