We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10378
    • 375 Posts
    I have the following problem:

    I created a custom resource type which also includes a rich-text editor field.
    If someone manually changes the width of the rich-text editor (by dragging the handle in the bottom right corner) when creating or editing resources, this custom width is used in all future sessions and in all places where the rich-text editor is loaded. So it seems to save its state somewhere.

    The editor doesn't adjust its width automatically any longer.

    I checked this in default resources and also in an Articles resource - same problem everywhere!

    How can I stop this? Is there a way to control this behavior in ExtJS?
    The editor should simply extend its width to the width of its parent container element.

    This are the code parts:

            ...
            var ct = this.getContentField(config);
            if (ct) {
                mlf.push({
                    title: _('goodnews.mail_body')
                    ,id: 'modx-resource-content'
                    ,layout: 'form'
                    ,bodyCssClass: 'main-wrapper'
                    ,autoHeight: true
                    ,collapsible: false
                    ,animCollapse: false
                    ,hideMode: 'offsets'
                    ,items: ct
                    ,style: 'margin-top: 10px'
                });
            }
            return mlf;
            ...
    


        ...
        ,getContentField: function(config) {
            return [{
                id: 'modx-content-above'
                ,border: false
            },{
                xtype: 'textarea'
                ,name: 'ta'
                ,id: 'ta'
                ,hideLabel: true
                ,anchor: '100%'
                ,height: 400
                ,grow: false
                ,value: (config.record.content || config.record.ta) || ''
            },{
                id: 'modx-content-below'
                ,border: false
            }];
        }
        ...
    


    MODx Revo 2.2.7
    TinyMCE 4.3.3

    Greetings,
    Martin

    This question has been answered by gadgetto. See the first response.

      Freelancer @bitego http://www.bitego.com
      ---
      GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
      More infos here: http://www.bitego.com/extras/goodnews/
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sounds to me like this has something to do with a cookie, and is handled in the TinyMCE code, not actually part of the MODx code.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10378
        • 375 Posts
        So there is nothing to do about this?
          Freelancer @bitego http://www.bitego.com
          ---
          GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
          More infos here: http://www.bitego.com/extras/goodnews/
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          There is a configuration item in the plugin itself, theme_advanced_resize_horizontal that is on by default. Turn that off to prevent resizing.

          In assets/components/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js you can search for theme_advanced_resizing_use_cookie and change the 1 to a 0 to allow resizing, but not maintaining the size (in the source file, assets/components/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js on line 182).

          While the default resize_horizontal is overridden by the configuration setting, there is no override available for the use_cookie setting.

          This apparently is only done in the advanced theme, so you could also prevent it by using a different theme (in System Settings).
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 10378
            • 375 Posts
            Quote from: sottwell at May 27, 2013, 12:08 AM
            There is a configuration item in the plugin itself, theme_advanced_resize_horizontal that is on by default. Turn that off to prevent resizing.

            In assets/components/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js you can search for theme_advanced_resizing_use_cookie and change the 1 to a 0 to allow resizing, but not maintaining the size (in the source file, assets/components/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js on line 182).

            While the default resize_horizontal is overridden by the configuration setting, there is no override available for the use_cookie setting.

            This apparently is only done in the advanced theme, so you could also prevent it by using a different theme (in System Settings).

            Thank you Susan, I'l try that. I'll also try if I can override the behavior by CSS.
              Freelancer @bitego http://www.bitego.com
              ---
              GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
              More infos here: http://www.bitego.com/extras/goodnews/
            • discuss.answer
              • 10378
              • 375 Posts
              Problem solved - but not as you think: I'm using another WYSIWYG editor which doesn't have this problem!
                Freelancer @bitego http://www.bitego.com
                ---
                GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                More infos here: http://www.bitego.com/extras/goodnews/
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                That's always a good option wink
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org