Mercurial > hg > rc2
comparison skins/classic/splitter.js @ 8:bf99236cc5cd default tip
try to recover from upgrade fail
author | Charlie Root |
---|---|
date | Sat, 29 Dec 2018 07:07:34 -0500 |
parents | 4681f974d28b |
children |
comparison
equal
deleted
inserted
replaced
7:65fd7d441cf1 | 8:bf99236cc5cd |
---|---|
81 var lh = this.layer.height; | 81 var lh = this.layer.height; |
82 this.p1.style.height = Math.floor(this.pos - this.p1pos.top - lh / 2) + 'px'; | 82 this.p1.style.height = Math.floor(this.pos - this.p1pos.top - lh / 2) + 'px'; |
83 this.p2.style.top = Math.ceil(this.pos + lh / 2) + 'px'; | 83 this.p2.style.top = Math.ceil(this.pos + lh / 2) + 'px'; |
84 this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1)); | 84 this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1)); |
85 if (bw.ie) { | 85 if (bw.ie) { |
86 var new_height = parseInt(this.p2.parentNode.offsetHeight, 10) - parseInt(this.p2.style.top, 10) - (bw.ie8 ? 2 : 0); | 86 var new_height = parseInt(this.p2.parentNode.offsetHeight, 10) - parseInt(this.p2.style.top, 10); |
87 this.p2.style.height = (new_height > 0 ? new_height : 0) + 'px'; | 87 this.p2.style.height = (new_height > 0 ? new_height : 0) + 'px'; |
88 } | 88 } |
89 } | 89 } |
90 else { | 90 else { |
91 this.p1.style.width = Math.floor(this.pos - this.p1pos.left - this.layer.width / 2) + 'px'; | 91 this.p1.style.width = Math.floor(this.pos - this.p1pos.left - this.layer.width / 2) + 'px'; |
113 | 113 |
114 me.p1pos = me.relative ? $(me.p1).position() : $(me.p1).offset(); | 114 me.p1pos = me.relative ? $(me.p1).position() : $(me.p1).offset(); |
115 me.p2pos = me.relative ? $(me.p2).position() : $(me.p2).offset(); | 115 me.p2pos = me.relative ? $(me.p2).position() : $(me.p2).offset(); |
116 | 116 |
117 // start listening to mousemove events | 117 // start listening to mousemove events |
118 $(document).bind('mousemove.'+me.id, onDrag).bind('mouseup.'+me.id, onDragStop); | 118 $(document).on('mousemove.' + me.id, onDrag).on('mouseup.' + me.id, onDragStop); |
119 | 119 |
120 // enable dragging above iframes | 120 // enable dragging above iframes |
121 $('iframe').each(function() { | 121 $('iframe').each(function() { |
122 $('<div class="iframe-splitter-fix"></div>') | 122 $('<div class="iframe-splitter-fix"></div>') |
123 .css({background: '#fff', | 123 .css({background: '#fff', |
179 // resume the ability to highlight text | 179 // resume the ability to highlight text |
180 if (bw.konq || bw.chrome || bw.safari) | 180 if (bw.konq || bw.chrome || bw.safari) |
181 document.body.style.webkitUserSelect = 'auto'; | 181 document.body.style.webkitUserSelect = 'auto'; |
182 | 182 |
183 // cancel the listening for drag events | 183 // cancel the listening for drag events |
184 $(document).unbind('.' + me.id); | 184 $(document).off('.' + me.id); |
185 | 185 |
186 // remove temp divs | 186 // remove temp divs |
187 $('div.iframe-splitter-fix').remove(); | 187 $('div.iframe-splitter-fix').remove(); |
188 | 188 |
189 me.set_cookie(); | 189 me.set_cookie(); |
198 * Handler for window resize events | 198 * Handler for window resize events |
199 */ | 199 */ |
200 function onResize(e) | 200 function onResize(e) |
201 { | 201 { |
202 if (me.horizontal) { | 202 if (me.horizontal) { |
203 var new_height = parseInt(me.p2.parentNode.offsetHeight, 10) - parseInt(me.p2.style.top, 10) - (bw.ie8 ? 2 : 0); | 203 var new_height = parseInt(me.p2.parentNode.offsetHeight, 10) - parseInt(me.p2.style.top, 10); |
204 me.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; | 204 me.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; |
205 } | 205 } |
206 else { | 206 else { |
207 var new_width = parseInt(me.p2.parentNode.offsetWidth, 10) - parseInt(me.p2.style.left, 10); | 207 var new_width = parseInt(me.p2.parentNode.offsetWidth, 10) - parseInt(me.p2.style.left, 10); |
208 me.p2.style.width = (new_width > 0 ? new_width : 0) + 'px'; | 208 me.p2.style.width = (new_width > 0 ? new_width : 0) + 'px'; |