File adding support, editor enhancements, JS improved.

This commit is contained in:
Dane Everitt
2016-10-03 20:22:28 -04:00
parent 50b377d08c
commit 81dc74a175
4 changed files with 83 additions and 41 deletions

View File

@@ -99,7 +99,11 @@ class ActionsClass {
inputField.focus();
inputField.on('blur keypress', e => {
// Save Field
if (e.type === 'blur' || (e.type === 'keypress' && e.which === 27) || currentName === inputField.val()) {
if (
(e.type === 'keypress' && e.which === 27)
|| e.type === 'blur'
|| (e.type === 'keypress' && e.which === 13 && currentName === inputField.val())
) {
if (!_.isEmpty(currentLink)) {
nameBlock.html(currentLink);
} else {
@@ -110,6 +114,10 @@ class ActionsClass {
return;
}
if (e.type === 'keypress' && e.which !== 13) return;
console.log('did not');
inputLoader.show();
const currentPath = decodeURIComponent(nameBlock.data('path'));