Code Duplication    Length = 73-73 lines in 2 locations

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

@@ 2211-2283 (lines=73) @@
2208
        self$$1._lastLayoutRect = {};
2209
        return layoutRect;
2210
      },
2211
      layoutRect: function (newRect) {
2212
        var self$$1 = this;
2213
        var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
2214
        if (!curRect) {
2215
          curRect = self$$1.initLayoutRect();
2216
        }
2217
        if (newRect) {
2218
          deltaWidth = curRect.deltaW;
2219
          deltaHeight = curRect.deltaH;
2220
          if (newRect.x !== undefined) {
2221
            curRect.x = newRect.x;
2222
          }
2223
          if (newRect.y !== undefined) {
2224
            curRect.y = newRect.y;
2225
          }
2226
          if (newRect.minW !== undefined) {
2227
            curRect.minW = newRect.minW;
2228
          }
2229
          if (newRect.minH !== undefined) {
2230
            curRect.minH = newRect.minH;
2231
          }
2232
          size = newRect.w;
2233
          if (size !== undefined) {
2234
            size = size < curRect.minW ? curRect.minW : size;
2235
            size = size > curRect.maxW ? curRect.maxW : size;
2236
            curRect.w = size;
2237
            curRect.innerW = size - deltaWidth;
2238
          }
2239
          size = newRect.h;
2240
          if (size !== undefined) {
2241
            size = size < curRect.minH ? curRect.minH : size;
2242
            size = size > curRect.maxH ? curRect.maxH : size;
2243
            curRect.h = size;
2244
            curRect.innerH = size - deltaHeight;
2245
          }
2246
          size = newRect.innerW;
2247
          if (size !== undefined) {
2248
            size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
2249
            size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
2250
            curRect.innerW = size;
2251
            curRect.w = size + deltaWidth;
2252
          }
2253
          size = newRect.innerH;
2254
          if (size !== undefined) {
2255
            size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
2256
            size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
2257
            curRect.innerH = size;
2258
            curRect.h = size + deltaHeight;
2259
          }
2260
          if (newRect.contentW !== undefined) {
2261
            curRect.contentW = newRect.contentW;
2262
          }
2263
          if (newRect.contentH !== undefined) {
2264
            curRect.contentH = newRect.contentH;
2265
          }
2266
          lastLayoutRect = self$$1._lastLayoutRect;
2267
          if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
2268
            repaintControls = Control.repaintControls;
2269
            if (repaintControls) {
2270
              if (repaintControls.map && !repaintControls.map[self$$1._id]) {
2271
                repaintControls.push(self$$1);
2272
                repaintControls.map[self$$1._id] = true;
2273
              }
2274
            }
2275
            lastLayoutRect.x = curRect.x;
2276
            lastLayoutRect.y = curRect.y;
2277
            lastLayoutRect.w = curRect.w;
2278
            lastLayoutRect.h = curRect.h;
2279
          }
2280
          return self$$1;
2281
        }
2282
        return curRect;
2283
      },
2284
      repaint: function () {
2285
        var self$$1 = this;
2286
        var style, bodyStyle, bodyElm, rect, borderBox;

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

@@ 1702-1774 (lines=73) @@
1699
        self$$1._lastLayoutRect = {};
1700
        return layoutRect;
1701
      },
1702
      layoutRect: function (newRect) {
1703
        var self$$1 = this;
1704
        var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
1705
        if (!curRect) {
1706
          curRect = self$$1.initLayoutRect();
1707
        }
1708
        if (newRect) {
1709
          deltaWidth = curRect.deltaW;
1710
          deltaHeight = curRect.deltaH;
1711
          if (newRect.x !== undefined) {
1712
            curRect.x = newRect.x;
1713
          }
1714
          if (newRect.y !== undefined) {
1715
            curRect.y = newRect.y;
1716
          }
1717
          if (newRect.minW !== undefined) {
1718
            curRect.minW = newRect.minW;
1719
          }
1720
          if (newRect.minH !== undefined) {
1721
            curRect.minH = newRect.minH;
1722
          }
1723
          size = newRect.w;
1724
          if (size !== undefined) {
1725
            size = size < curRect.minW ? curRect.minW : size;
1726
            size = size > curRect.maxW ? curRect.maxW : size;
1727
            curRect.w = size;
1728
            curRect.innerW = size - deltaWidth;
1729
          }
1730
          size = newRect.h;
1731
          if (size !== undefined) {
1732
            size = size < curRect.minH ? curRect.minH : size;
1733
            size = size > curRect.maxH ? curRect.maxH : size;
1734
            curRect.h = size;
1735
            curRect.innerH = size - deltaHeight;
1736
          }
1737
          size = newRect.innerW;
1738
          if (size !== undefined) {
1739
            size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
1740
            size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
1741
            curRect.innerW = size;
1742
            curRect.w = size + deltaWidth;
1743
          }
1744
          size = newRect.innerH;
1745
          if (size !== undefined) {
1746
            size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
1747
            size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
1748
            curRect.innerH = size;
1749
            curRect.h = size + deltaHeight;
1750
          }
1751
          if (newRect.contentW !== undefined) {
1752
            curRect.contentW = newRect.contentW;
1753
          }
1754
          if (newRect.contentH !== undefined) {
1755
            curRect.contentH = newRect.contentH;
1756
          }
1757
          lastLayoutRect = self$$1._lastLayoutRect;
1758
          if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
1759
            repaintControls = Control.repaintControls;
1760
            if (repaintControls) {
1761
              if (repaintControls.map && !repaintControls.map[self$$1._id]) {
1762
                repaintControls.push(self$$1);
1763
                repaintControls.map[self$$1._id] = true;
1764
              }
1765
            }
1766
            lastLayoutRect.x = curRect.x;
1767
            lastLayoutRect.y = curRect.y;
1768
            lastLayoutRect.w = curRect.w;
1769
            lastLayoutRect.h = curRect.h;
1770
          }
1771
          return self$$1;
1772
        }
1773
        return curRect;
1774
      },
1775
      repaint: function () {
1776
        var self$$1 = this;
1777
        var style, bodyStyle, bodyElm, rect, borderBox;