-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathExtensionsToolbar.js
More file actions
30 lines (23 loc) · 1.14 KB
/
ExtensionsToolbar.js
File metadata and controls
30 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, brackets, $, window */
define(function (require, exports, module) {
'use strict';
var CommandManager = brackets.getModule("command/CommandManager"),
Commands = brackets.getModule("command/Commands");
function addToToolbar(buttonTitle, callback) {
var $extensionsToolbar, $mdnButton;
$extensionsToolbar = $('#extensions-toolbar');
if ($extensionsToolbar.length === 0) {
$extensionsToolbar = $('<div id="extensions-toolbar"></div>');
$extensionsToolbar.css('padding', '6px');
$extensionsToolbar.css('z-index', '0');
$('#main-toolbar').after($extensionsToolbar);
}
$mdnButton = $('<button class="btn small" style="margin-right:10px;"></button> ').html(buttonTitle);
$extensionsToolbar.append($mdnButton);
$mdnButton.on('click', function () {
CommandManager.execute(Commands.SHOW_INLINE_EDITOR, callback);
});
}
exports.addToToolbar = addToToolbar;
});