Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontSize dropdown value doesn't update when increment font size using custom button #548

Closed
qasid opened this issue Jun 15, 2016 · 4 comments

Comments

@qasid
Copy link

qasid commented Jun 15, 2016

Steps

  1. Create new button "button-ifontsize" following steps defined here. and on click call "handleClick" function.
handleClick: function() {

      let editor = this.props.editor.get("nativeEditor");
      let parentNode= document.getSelection().extentNode.parentNode;
      let fontSizePX= window.getComputedStyle(parentNode, null).getPropertyValue('font-size');
      let nfontSize= parseInt(fontSizePX);

      nfontSize = nfontSize + 1;

      value = nfontSize +'px';
      var vars= {};
      vars["size"]= value;
      CKEDITOR.config.fontSize_style= {
        element: 'span',
        styles: { 'font-size': '#(size)' },
        overrides: [ {
            element: 'font', attributes: { 'size': null }
        } ]
      };
      let  styles={};
      styles= new CKEDITOR.style( CKEDITOR.config.fontSize_style,   vars );
            editor.applyStyle( styles );
      editor.fire("actionPerformed",this);
    },

getDefaultProps: function() {

        return {

            style: {
                styles: {
                  'font-size': '#(size)' },
                }


        };
    },

statics: {
        key: 'ifontsize'
    },

  1. Add 'FontSize', 'ifontsize' as new text selection buttons.(FontSize in font plugin)
  2. Create a div placeholder <div class="ae-placeholder" contenteditable="true" data-placeholder="Write here the description" id="description"></div> in html file.
  3. Enter sample text.
  4. Select text. Toolbar is rendered.
  5. Select size from FontSize drop down. Size is applied
  6. Increment font size using "ifontsize" button.

Expected result
Size is applied and FontSize drop down value also changes.

Actual result
Size is applied but FontSize drop down value doesn't change.

This only happens when toolbar is rendered first time. Any selection after that changes the FontSize dropdown value with similar steps.

@ipeychev
Copy link
Contributor

/cc @jbalsas

@jbalsas
Copy link
Contributor

jbalsas commented Jun 24, 2016

Will take a look

@qasid
Copy link
Author

qasid commented Jul 11, 2016

Hello @jbalsas, @ipeychev , any update on this?

@jbalsas
Copy link
Contributor

jbalsas commented Jul 11, 2016

Hey @qasid, I'm really sorry, I got diverted to different matters... @antoniopol06 will take a look asap!

ipeychev added a commit that referenced this issue Jul 12, 2016
ipeychev added a commit that referenced this issue Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants