Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Object.assign(Editor.prototype, require('./function-bind'), require('./events'),

// External event listeners
window.addEventListener('click', this.hideAllTheThings);
document.body.addEventListener('keydown', this.disableBackButton);

this.createBlocks();
this.wrapper.classList.add('st-ready');
Expand Down Expand Up @@ -158,7 +157,6 @@ Object.assign(Editor.prototype, require('./function-bind'), require('./events'),

// Remove external event listeners
window.removeEventListener('click', this.hideAllTheThings);
document.body.removeEventListener('keydown', this.disableBackButton);

// Clear the store
this.store.reset();
Expand Down Expand Up @@ -316,23 +314,6 @@ Object.assign(Editor.prototype, require('./function-bind'), require('./events'),
this.store.addData(blockData);
},

/*
* Disable back button so when a block loses focus the user
* pressing backspace multiple times doesn't close the page.
*/
disableBackButton: function(e) {
var target = e.target || e.srcElement;
if (e.keyCode === 8) {
if (target.getAttribute('contenteditable') ||
target.tagName === 'INPUT' ||
target.tagName === 'TEXTAREA') {
return;
}

e.preventDefault();
}
},

findBlockById: function(block_id) {
return this.blockManager.findBlockById(block_id);
},
Expand Down