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

How to add button to default layout? #185

Open
jfmdev opened this issue Nov 25, 2015 · 1 comment
Open

How to add button to default layout? #185

jfmdev opened this issue Nov 25, 2015 · 1 comment

Comments

@jfmdev
Copy link

jfmdev commented Nov 25, 2015

Hi, I have successfully followed the tutorial Creating a basic Raptor Button.

However, when using this code:

      $('.editable').raptor({
        layouts: {
            toolbar: {
                uiOrder: [
                    ['cancel', 'custom-button']
                ]
            },
            hoverPanel: {
                uiOrder: [
                    ['clickButtonToEdit']
                ]
            },
        }
    });

All buttons disappears from Raptor Editor, except the Cancel button and the Custom button.
And if I do not define the toolbal parameter:

      $('.editable').raptor({

    });

Then all the standard buttons appears, except the Custom button.

Is there a way of adding a new custom button and display it along with the default buttons?

@deeknow
Copy link

deeknow commented Dec 8, 2015

Hey @jfmdev yes you can do what you are asking. Take a look at the following example.. https://github.com/PANmedia/raptor-example/blob/master/examples/custom-button/example.php

You'll notice that the custom button is added to the left side of the toolbar (ie the zero-th button group, and using unshift to add to the beginning of the button array). If you want to add it to another group just enter it's index in uiOrder[index-here] and if you want to add it to the end of a button group use push() instead of unshift()

Hope that helps. Please let us know if it does and we'll close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants