Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 1920-1948 (lines=29) @@
1917
    var Binding = function (settings) {
1918
      this.create = settings.create;
1919
    };
1920
    Binding.create = function (model, name) {
1921
      return new Binding({
1922
        create: function (otherModel, otherName) {
1923
          var bindings;
1924
          var fromSelfToOther = function (e) {
1925
            otherModel.set(otherName, e.value);
1926
          };
1927
          var fromOtherToSelf = function (e) {
1928
            model.set(name, e.value);
1929
          };
1930
          otherModel.on('change:' + otherName, fromOtherToSelf);
1931
          model.on('change:' + name, fromSelfToOther);
1932
          bindings = otherModel._bindings;
1933
          if (!bindings) {
1934
            bindings = otherModel._bindings = [];
1935
            otherModel.on('destroy', function () {
1936
              var i = bindings.length;
1937
              while (i--) {
1938
                bindings[i]();
1939
              }
1940
            });
1941
          }
1942
          bindings.push(function () {
1943
            model.off('change:' + name, fromSelfToOther);
1944
          });
1945
          return model.get(name);
1946
        }
1947
      });
1948
    };
1949
1950
    var global$c = tinymce.util.Tools.resolve('tinymce.util.Observable');
1951

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

@@ 1380-1408 (lines=29) @@
1377
    var Binding = function (settings) {
1378
      this.create = settings.create;
1379
    };
1380
    Binding.create = function (model, name) {
1381
      return new Binding({
1382
        create: function (otherModel, otherName) {
1383
          var bindings;
1384
          var fromSelfToOther = function (e) {
1385
            otherModel.set(otherName, e.value);
1386
          };
1387
          var fromOtherToSelf = function (e) {
1388
            model.set(name, e.value);
1389
          };
1390
          otherModel.on('change:' + otherName, fromOtherToSelf);
1391
          model.on('change:' + name, fromSelfToOther);
1392
          bindings = otherModel._bindings;
1393
          if (!bindings) {
1394
            bindings = otherModel._bindings = [];
1395
            otherModel.on('destroy', function () {
1396
              var i = bindings.length;
1397
              while (i--) {
1398
                bindings[i]();
1399
              }
1400
            });
1401
          }
1402
          bindings.push(function () {
1403
            model.off('change:' + name, fromSelfToOther);
1404
          });
1405
          return model.get(name);
1406
        }
1407
      });
1408
    };
1409
1410
    var global$a = tinymce.util.Tools.resolve('tinymce.util.Observable');
1411