Skip to content

Instantly share code, notes, and snippets.

@brandoncordell
Created October 7, 2011 19:41
Show Gist options
  • Save brandoncordell/1271187 to your computer and use it in GitHub Desktop.
Save brandoncordell/1271187 to your computer and use it in GitHub Desktop.
help
createToolbar : function(editor){
var me = this,
items = [],
tipsEnabled = Ext.tip.QuickTipManager && Ext.tip.QuickTipManager.isEnabled(),
baseCSSPrefix = Ext.baseCSSPrefix,
fontSelectItem, toolbar, undef;
function btn(id, toggle, handler){
return {
itemId : id,
cls : baseCSSPrefix + 'btn-icon',
iconCls: baseCSSPrefix + 'edit-'+id,
enableToggle:toggle !== false,
scope: editor,
handler:handler||editor.relayBtnCmd,
clickEvent:'mousedown',
tooltip: tipsEnabled ? editor.buttonTips[id] || undef : undef,
overflowText: editor.buttonTips[id].title || undef,
tabIndex:-1
};
}
# THIS IS WHAT I TRIED THATS GIVING ME THE ERROR
createToolbar: (editor) ->
me = @
items = []
tipsEnabled = Ext.tip.QuickTipManager && Ext.tip.QuickTipManager.isEnabled()
baseCSSPrefix = Ext.baseCSSPrefix
btn (id, toggle, handler) ->
itemId : id
cls : baseCSSPrefix + 'btn-icon'
iconCls: baseCSSPrefix + 'edit-'+id
enableToggle: toggle isnt false
scope: editor
handler: handler or editor.relayBtnCmd
clickEvent: 'mousedown'
tooltip: if tipsEnabled then editor.buttonTips[id] || undef else undef
overflowText: editor.buttonTips[id].title or undef
tabIndex: -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment