Skip to content

Commit

Permalink
MDL-44215 Atto: Setting toolbar to break at predetermined point
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr authored and Damyon Wiese committed Mar 26, 2014
1 parent 9ee8a35 commit b5a83da
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/editor/atto/plugins/collapse/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media (max-width: 768px) {
.toolbarbreak {
display: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ M.atto_collapse = M.atto_collapse || {
after_init : function(params) {
var toolbar = M.editor_atto.get_toolbar_node(params.elementid);
var button = toolbar.one(SELECTORS.BUTTON);
var firstgroup = toolbar.all(SELECTORS.GROUPS).item(this.showgroups);

// Set the toolbar to break after the initial those displayed by default.
firstgroup.insert('<div class="toolbarbreak"></div>', 'before');
// Set the state to "not collapsed" (which is the state when the page loads).
button.setData('collapsed', false);
// Call toggle to change the state when the page loads to "collapsed".
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ M.atto_collapse = M.atto_collapse || {
after_init : function(params) {
var toolbar = M.editor_atto.get_toolbar_node(params.elementid);
var button = toolbar.one(SELECTORS.BUTTON);
var firstgroup = toolbar.all(SELECTORS.GROUPS).item(this.showgroups);

// Set the toolbar to break after the initial those displayed by default.
firstgroup.insert('<div class="toolbarbreak"></div>', 'before');
// Set the state to "not collapsed" (which is the state when the page loads).
button.setData('collapsed', false);
// Call toggle to change the state when the page loads to "collapsed".
Expand Down
3 changes: 3 additions & 0 deletions lib/editor/atto/plugins/collapse/yui/src/button/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ M.atto_collapse = M.atto_collapse || {
after_init : function(params) {
var toolbar = M.editor_atto.get_toolbar_node(params.elementid);
var button = toolbar.one(SELECTORS.BUTTON);
var firstgroup = toolbar.all(SELECTORS.GROUPS).item(this.showgroups);

// Set the toolbar to break after the initial those displayed by default.
firstgroup.insert('<div class="toolbarbreak"></div>', 'before');
// Set the state to "not collapsed" (which is the state when the page loads).
button.setData('collapsed', false);
// Call toggle to change the state when the page loads to "collapsed".
Expand Down

0 comments on commit b5a83da

Please sign in to comment.