Code Duplication    Length = 34-34 lines in 2 locations

public/js/tinymce/themes/modern/theme.js 1 location

@@ 2605-2638 (lines=34) @@
2602
      },
2603
      bindStates: function () {
2604
      },
2605
      scrollIntoView: function (align) {
2606
        function getOffset(elm, rootElm) {
2607
          var x, y, parent$$1 = elm;
2608
          x = y = 0;
2609
          while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
2610
            x += parent$$1.offsetLeft || 0;
2611
            y += parent$$1.offsetTop || 0;
2612
            parent$$1 = parent$$1.offsetParent;
2613
          }
2614
          return {
2615
            x: x,
2616
            y: y
2617
          };
2618
        }
2619
        var elm = this.getEl(), parentElm = elm.parentNode;
2620
        var x, y, width, height, parentWidth, parentHeight;
2621
        var pos = getOffset(elm, parentElm);
2622
        x = pos.x;
2623
        y = pos.y;
2624
        width = elm.offsetWidth;
2625
        height = elm.offsetHeight;
2626
        parentWidth = parentElm.clientWidth;
2627
        parentHeight = parentElm.clientHeight;
2628
        if (align === 'end') {
2629
          x -= parentWidth - width;
2630
          y -= parentHeight - height;
2631
        } else if (align === 'center') {
2632
          x -= parentWidth / 2 - width / 2;
2633
          y -= parentHeight / 2 - height / 2;
2634
        }
2635
        parentElm.scrollLeft = x;
2636
        parentElm.scrollTop = y;
2637
        return this;
2638
      },
2639
      getRoot: function () {
2640
        var ctrl = this, rootControl;
2641
        var parents = [];

public/js/tinymce/themes/inlite/theme.js 1 location

@@ 2096-2129 (lines=34) @@
2093
      },
2094
      bindStates: function () {
2095
      },
2096
      scrollIntoView: function (align) {
2097
        function getOffset(elm, rootElm) {
2098
          var x, y, parent$$1 = elm;
2099
          x = y = 0;
2100
          while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
2101
            x += parent$$1.offsetLeft || 0;
2102
            y += parent$$1.offsetTop || 0;
2103
            parent$$1 = parent$$1.offsetParent;
2104
          }
2105
          return {
2106
            x: x,
2107
            y: y
2108
          };
2109
        }
2110
        var elm = this.getEl(), parentElm = elm.parentNode;
2111
        var x, y, width, height, parentWidth, parentHeight;
2112
        var pos = getOffset(elm, parentElm);
2113
        x = pos.x;
2114
        y = pos.y;
2115
        width = elm.offsetWidth;
2116
        height = elm.offsetHeight;
2117
        parentWidth = parentElm.clientWidth;
2118
        parentHeight = parentElm.clientHeight;
2119
        if (align === 'end') {
2120
          x -= parentWidth - width;
2121
          y -= parentHeight - height;
2122
        } else if (align === 'center') {
2123
          x -= parentWidth / 2 - width / 2;
2124
          y -= parentHeight / 2 - height / 2;
2125
        }
2126
        parentElm.scrollLeft = x;
2127
        parentElm.scrollTop = y;
2128
        return this;
2129
      },
2130
      getRoot: function () {
2131
        var ctrl = this, rootControl;
2132
        var parents = [];