forked from ujifgc/pagedown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (29 loc) · 872 Bytes
/
index.js
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
31
32
33
34
35
36
37
module.exports = DerbyPageDown;
function DerbyPageDown() {}
DerbyPageDown.prototype.view = __dirname;
DerbyPageDown.prototype.init = function(model) {
// to prevent any 'undefined' texts from appearing
model.setNull('text', '');
};
DerbyPageDown.prototype.create = function(model) {
var self = this;
Editor = require("./src/js/Markdown.Editor");
editor = this.editor = new Editor(this);
editor.run();
this.expandingArea.className += " active";
model.on('change', model.at('autofocus'), function(val) {
if (val) {
self.input.focus();
}
});
};
DerbyPageDown.prototype.focus = function(ev, el) {
this.model.del('autofocus');
};
DerbyPageDown.prototype.emitKeydown = function(ev, el) {
this.emit("keydown", ev, el);
};
DerbyPageDown.prototype.toolbar = function(which) {
var t = this.model.get('toolbar');
return !t || t.indexOf(which) !== -1;
};