Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 8571-8593 (lines=23) @@
8568
      activeMenu: function (state) {
8569
        this.classes.toggle('active', state);
8570
      },
8571
      renderHtml: function () {
8572
        var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
8573
        var icon = self$$1.settings.icon, image;
8574
        var text = self$$1.state.get('text');
8575
        var textHtml = '';
8576
        image = self$$1.settings.image;
8577
        if (image) {
8578
          icon = 'none';
8579
          if (typeof image !== 'string') {
8580
            image = window.getSelection ? image[0] : image[1];
8581
          }
8582
          image = ' style="background-image: url(\'' + image + '\')"';
8583
        } else {
8584
          image = '';
8585
        }
8586
        if (text) {
8587
          self$$1.classes.add('btn-has-text');
8588
          textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
8589
        }
8590
        icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
8591
        self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
8592
        return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
8593
      },
8594
      postRender: function () {
8595
        var self$$1 = this;
8596
        self$$1.on('click', function (e) {

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

@@ 8413-8435 (lines=23) @@
8410
      activeMenu: function (state) {
8411
        this.classes.toggle('active', state);
8412
      },
8413
      renderHtml: function () {
8414
        var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
8415
        var icon = self$$1.settings.icon, image;
8416
        var text = self$$1.state.get('text');
8417
        var textHtml = '';
8418
        image = self$$1.settings.image;
8419
        if (image) {
8420
          icon = 'none';
8421
          if (typeof image !== 'string') {
8422
            image = window.getSelection ? image[0] : image[1];
8423
          }
8424
          image = ' style="background-image: url(\'' + image + '\')"';
8425
        } else {
8426
          image = '';
8427
        }
8428
        if (text) {
8429
          self$$1.classes.add('btn-has-text');
8430
          textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
8431
        }
8432
        icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
8433
        self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
8434
        return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
8435
      },
8436
      postRender: function () {
8437
        var self$$1 = this;
8438
        self$$1.on('click', function (e) {