|
471 | 471 | var domLoaded = function (callback) {
|
472 | 472 | /* Internet Explorer */
|
473 | 473 | /*@cc_on
|
474 |
| - @if (@_win32 || @_win64) |
475 |
| - document.write('<script id="ieScriptLoad" defer src="//:"><\/script>'); |
476 |
| - document.getElementById('ieScriptLoad').onreadystatechange = function() { |
477 |
| - if (this.readyState == 'complete') { |
478 |
| - callback(); |
479 |
| - } |
480 |
| - }; |
481 |
| - @end @*/ |
| 474 | + @if (@_win32 || @_win64) |
| 475 | + document.write('<script id="ieScriptLoad" defer src="//:"><\/script>'); |
| 476 | + document.getElementById('ieScriptLoad').onreadystatechange = function() { |
| 477 | + if (this.readyState == 'complete') { |
| 478 | + callback(); |
| 479 | + } |
| 480 | + }; |
| 481 | + @end @*/ |
482 | 482 | /* Mozilla, Chrome, Opera */
|
483 | 483 | if (document.addEventListener) {
|
484 | 484 | document.addEventListener('DOMContentLoaded', callback, false);
|
|
509 | 509 | ElementQueries.listen();
|
510 | 510 | }
|
511 | 511 | })();
|
512 |
| - |
513 | 512 | }).call(this,require("g5I+bs"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/css-element-queries/src/ElementQueries.js","/css-element-queries/src")
|
514 | 513 | },{"./ResizeSensor":2,"buffer":5,"g5I+bs":14}],2:[function(require,module,exports){
|
515 | 514 | (function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
|
|
521 | 520 | ;
|
522 | 521 | (function() {
|
523 | 522 |
|
| 523 | + var requestAnimationFrame = window.requestAnimationFrame || |
| 524 | + window.mozRequestAnimationFrame || |
| 525 | + window.webkitRequestAnimationFrame || |
| 526 | + function (fn) { |
| 527 | + return window.setTimeout(fn, 20); |
| 528 | + }; |
| 529 | + |
524 | 530 | /**
|
525 | 531 | * Class for dimension change detection.
|
526 | 532 | *
|
|
599 | 605 | var expand = element.resizeSensor.childNodes[0];
|
600 | 606 | var expandChild = expand.childNodes[0];
|
601 | 607 | var shrink = element.resizeSensor.childNodes[1];
|
602 |
| - var shrinkChild = shrink.childNodes[0]; |
603 |
| - |
604 |
| - var lastWidth, lastHeight; |
605 | 608 |
|
606 | 609 | var reset = function() {
|
607 |
| - expandChild.style.width = expand.offsetWidth + 10 + 'px'; |
608 |
| - expandChild.style.height = expand.offsetHeight + 10 + 'px'; |
609 |
| - expand.scrollLeft = expand.scrollWidth; |
610 |
| - expand.scrollTop = expand.scrollHeight; |
611 |
| - shrink.scrollLeft = shrink.scrollWidth; |
612 |
| - shrink.scrollTop = shrink.scrollHeight; |
613 |
| - lastWidth = element.offsetWidth; |
614 |
| - lastHeight = element.offsetHeight; |
| 610 | + expandChild.style.width = 100000 + 'px'; |
| 611 | + expandChild.style.height = 100000 + 'px'; |
| 612 | + |
| 613 | + expand.scrollLeft = 100000; |
| 614 | + expand.scrollTop = 100000; |
| 615 | + |
| 616 | + shrink.scrollLeft = 100000; |
| 617 | + shrink.scrollTop = 100000; |
615 | 618 | };
|
616 | 619 |
|
617 | 620 | reset();
|
| 621 | + var dirty = false; |
618 | 622 |
|
619 |
| - var changed = function() { |
620 |
| - if (element.resizedAttached) { |
| 623 | + var dirtyChecking = function() { |
| 624 | + if (!element.resizedAttached) return; |
| 625 | + |
| 626 | + if (dirty) { |
621 | 627 | element.resizedAttached.call();
|
| 628 | + dirty = false; |
622 | 629 | }
|
| 630 | + |
| 631 | + requestAnimationFrame(dirtyChecking); |
| 632 | + }; |
| 633 | + |
| 634 | + requestAnimationFrame(dirtyChecking); |
| 635 | + var lastWidth, lastHeight; |
| 636 | + var cachedWidth, cachedHeight; //useful to not query offsetWidth twice |
| 637 | + |
| 638 | + var onScroll = function() { |
| 639 | + if ((cachedWidth = element.offsetWidth) != lastWidth || (cachedHeight = element.offsetHeight) != lastHeight) { |
| 640 | + dirty = true; |
| 641 | + |
| 642 | + lastWidth = cachedWidth; |
| 643 | + lastHeight = cachedHeight; |
| 644 | + } |
| 645 | + reset(); |
623 | 646 | };
|
624 | 647 |
|
| 648 | + |
625 | 649 | var addEvent = function(el, name, cb) {
|
626 | 650 | if (el.attachEvent) {
|
627 | 651 | el.attachEvent('on' + name, cb);
|
|
630 | 654 | }
|
631 | 655 | };
|
632 | 656 |
|
633 |
| - var onScroll = function() { |
634 |
| - if (element.offsetWidth != lastWidth || element.offsetHeight != lastHeight) { |
635 |
| - changed(); |
636 |
| - } |
637 |
| - reset(); |
638 |
| - }; |
639 |
| - |
640 | 657 | addEvent(expand, 'scroll', onScroll);
|
641 | 658 | addEvent(shrink, 'scroll', onScroll);
|
642 | 659 | }
|
@@ -838,7 +855,7 @@ function example5(){
|
838 | 855 | box[0].innerHTML = (++changed) + ' changes. ' + box.parent()[0].clientWidth+'px/'+box.parent()[0].clientHeight+'px';
|
839 | 856 | });
|
840 | 857 | }
|
841 |
| -}).call(this,require("g5I+bs"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_cb029744.js","/") |
| 858 | +}).call(this,require("g5I+bs"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_fa898b42.js","/") |
842 | 859 | },{"./css-element-queries/src/ElementQueries":1,"./css-element-queries/src/ResizeSensor":2,"buffer":5,"codemirror/lib/codemirror":6,"codemirror/mode/css/css":7,"codemirror/mode/htmlmixed/htmlmixed":8,"codemirror/mode/javascript/javascript":9,"codemirror/mode/xml/xml":10,"g5I+bs":14,"hammerjs/hammer":11,"jQuery":13}],4:[function(require,module,exports){
|
843 | 860 | (function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
|
844 | 861 | var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
0 commit comments