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() {
|
init: function() {
|
||||||
g.callbacks.push(imgExpand.cb.node);
|
g.callbacks.push(imgExpand.cb.node);
|
||||||
imgExpand.dialog();
|
imgExpand.dialog();
|
||||||
return $.addStyle("body.fitheight img[md5] + img { max-height: " + d.body.clientHeight + "px }");
|
$.bind(window, 'resize', imgExpand.resize);
|
||||||
|
return imgExpand.resize();
|
||||||
},
|
},
|
||||||
cb: {
|
cb: {
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
@ -2225,6 +2226,14 @@
|
|||||||
$.bind($('input', controls), 'click', imgExpand.cb.all);
|
$.bind($('input', controls), 'click', imgExpand.cb.all);
|
||||||
delform = $('form[name=delform]');
|
delform = $('form[name=delform]');
|
||||||
return $.prepend(delform, controls);
|
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.';
|
NAMESPACE = 'AEOS.4chan_x.';
|
||||||
|
|||||||
@ -1637,8 +1637,8 @@ imgExpand =
|
|||||||
init: ->
|
init: ->
|
||||||
g.callbacks.push imgExpand.cb.node
|
g.callbacks.push imgExpand.cb.node
|
||||||
imgExpand.dialog()
|
imgExpand.dialog()
|
||||||
#FIXME add a resize listener
|
$.bind window, 'resize', imgExpand.resize
|
||||||
$.addStyle "body.fitheight img[md5] + img { max-height: #{d.body.clientHeight}px }"
|
imgExpand.resize()
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
node: (root) ->
|
node: (root) ->
|
||||||
@ -1711,6 +1711,11 @@ imgExpand =
|
|||||||
delform = $ 'form[name=delform]'
|
delform = $ 'form[name=delform]'
|
||||||
$.prepend delform, controls
|
$.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
|
#main
|
||||||
NAMESPACE = 'AEOS.4chan_x.'
|
NAMESPACE = 'AEOS.4chan_x.'
|
||||||
g =
|
g =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user