resize listener
This commit is contained in:
parent
d50b7034b8
commit
03e37241ab
11
4chan_x.js
11
4chan_x.js
@ -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.';
|
||||
|
||||
@ -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 =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user