CKEditor flex fail with jquery3 on ZK 9.1

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 4.14.0.1
    • Affects Version/s: 4.14.0.0
    • None

      Steps to Reproduce

      https://zkfiddle.org/sample/mp265j/24-ckeditor

      run on 9.1.0

      Current Result

      Editor text area height is 0px

      Expected Result

      Editor text area height is based on vflex calculation

      Debug Information

      happen in setFlexSizeH_, textArea.prev().outerHeight() returns undefined, causes h = h - topHeight - bottomHeight; to be calculated as NaN

      caused by change between jQuery version update in ZK 9.1.0

      https://api.jquery.com/outerHeight/
      jq(notExists).outerHeight() will be undefined, <3.0 was null

       

      Workaround

      <script><![CDATA[
          zk.afterLoad("ckez", function () {
              var _xCKeditor = {};
              zk.override(ckez.CKeditor.prototype, _xCKeditor, {
                  setFlexSizeH_: function(n, zkn, height, ignoreMargins) {
                      this._hflexHeight = height;
          
                      this.$super(ckez.CKeditor, 'setFlexSizeH_', n, zkn, height, ignoreMargins);
                      var h = parseInt(n.style.height); 
                      
                      n.style.height = '';
                      
                      
                      var textArea  = jq(n).find('.cke_contents'),
                          topHeight = textArea.prev().outerHeight() || 0, 
                          bottomHeight = textArea.next().outerHeight() || 0;
                      h = h - topHeight - bottomHeight;
          
                      
                      this._setSize(textArea, jq.px0(h), 'height');
                  }
               });
          });
      ]]></script>
      

            Assignee:
            rudyhuang
            Reporter:
            MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h