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

Tbeditor vflex overlapped other elements

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.5.0
    • Fix Version/s: None
    • Component/s: Components
    • Labels:
    • Environment:

      ZK 8.5.0

      Description

      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>
      

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              wenninghsu wenninghsu
              Reporter:
              rudyhuang rudyhuang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: