提交 e047d35e 编写于 作者: J Johan Preynat

Get rid of shortid to generate buttons ids

上级 9ca0dc7d
......@@ -18,7 +18,6 @@
"less": "2.6.0",
"less-plugin-clean-css": "1.5.1",
"mousetrap": "1.5.3",
"shortid": "2.2.6",
"uglify-js": "2.6.1"
},
"scripts": {
......
var $ = require('jquery');
var shortid = require('shortid');
var gitbook = window.gitbook;
// List of created buttons
var buttons = [];
var buttons = [],
// Generated Id for buttons
BTN_ID = 0;
function generateId() {
return 'btn-'+(BTN_ID++);
}
// Insert a jquery element at a specific position
function insertAt(parent, selector, index, element) {
......@@ -101,7 +106,7 @@ function createButton(opts) {
index: null,
// Button id for removal
id: shortid.generate()
id: generateId()
}, opts || {});
buttons.push(opts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册