Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3787

Tbeditor vflex overlapped other elements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.5.0
    • Components
    • ZK 8.5.0

      steps to reproduce

      http://zkfiddle.org/sample/33i8j5r/1-tbeditor-overlapped-other-elements
      run fiddle on Iceblue[8.5.0]
      click the "You can't hit me!" button

      actual result

      You can't hit that button.

      expected result

      Hit and "Impossible!!" popped up

      debug info

      The height of <div class="z-tbeditor"> is smaller than its content.

      root cause

      Tbeditor.js about line 125

      - jqn.find('ul').outerHeight(); //buttons' height
      

      In trumbowyg version 2.6.0, the buttons use <div> to enclose, not <ul>.

      Workaround

      Still have some problems, but half a loaf is better than none

      <script><![CDATA[
      zk.afterLoad('zkmax.inp', function () {
          zk.override(zkmax.inp.Tbeditor.prototype, {}, {
              _calcEditorHeight: function (height) {
              var jqn = jq(this.$n());
              var tbBox = jqn.children().eq(0);
              var btnPaneSclass = this.$s('button-pane');
              if (!tbBox) return null;
      
              return zk.parseInt(height) - zk.parseInt(tbBox.css('marginTop'))
                                      - zk.parseInt(tbBox.css('marginBottom'))
                                      - 2 * zk.parseInt(tbBox.css('border'))
                                      - jqn.find('.' + btnPaneSclass).outerHeight(); //buttons' height
              }
          });
      });
      ]]></script>
      

            CharlesQiu CharlesQiu
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes Time Not Required
                4h 30m