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

Add Controllable mixin #118

Merged
merged 1 commit into from
Dec 9, 2013
Merged

Conversation

jbaiter
Copy link
Contributor

@jbaiter jbaiter commented Nov 18, 2013

This adds a new Controllable mixin.

It allows blocks to specify custom UI elements that will be placed in the lower left corner of the block by default.
To do so, blocks will have to provide the following options:

controllable: true,
  controls: {
    'cmd-name': handlerFunction
}

To provide new icons for the custom UI elements, place a file cmd-name.svg into public/images/icons/src and re-generate the webfont via grunt webfont.

Example usage in my custom table block:
Table block
Source: https://github.com/jbaiter/sir-trevor-js/blob/tableblock/src/blocks/table.js

@sntran
Copy link

sntran commented Nov 18, 2013

Really nice! I ended up moving the UI to the top right, and added buttons there, but yours is much nicer.

@cjbell cjbell mentioned this pull request Nov 19, 2013
@ninjabiscuit
Copy link
Contributor

Sorry that we have't got back to this for such a long time. I think this would be a valuable addition to ST. It's relatively small code to add a really nice enhancement of ST's extensibility.

What do you think @cjbell88 and @andrewsprinz?

@andflett
Copy link
Contributor

andflett commented Dec 9, 2013

+1

@cjbell
Copy link
Contributor

cjbell commented Dec 9, 2013

+1 from me too. I started to merge this in on Friday. Will finish if you guys are all good with it.

Christopher Bell
Developer

+44 (0) 7817 971924
http://cjbell.co
chris@cjbell.co

On 9 Dec 2013, at 07:55, Andrew Sprinz notifications@github.com wrote:

+1


Reply to this email directly or view it on GitHub.

@andflett
Copy link
Contributor

andflett commented Dec 9, 2013

Definately

@cjbell cjbell merged commit 5ce2f04 into madebymany:master Dec 9, 2013
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

Successfully merging this pull request may close these issues.

5 participants