conditional show extensions
This commit is contained in:
11
vendor/assets/javascripts/transpiled.js
vendored
11
vendor/assets/javascripts/transpiled.js
vendored
@@ -515,7 +515,7 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
|
||||
});
|
||||
}
|
||||
};
|
||||
}).controller('EditorCtrl', function ($sce, $timeout, apiController, markdownRenderer, $rootScope) {
|
||||
}).controller('EditorCtrl', function ($sce, $timeout, apiController, markdownRenderer, $rootScope, extensionManager) {
|
||||
|
||||
this.setNote = function (note, oldNote) {
|
||||
this.editorMode = 'edit';
|
||||
@@ -533,6 +533,10 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
|
||||
}
|
||||
};
|
||||
|
||||
this.hasAvailableExtensions = function () {
|
||||
return extensionManager.extensionsInContextOfItem(this.note).length > 0;
|
||||
};
|
||||
|
||||
this.onPreviewDoubleClick = function () {
|
||||
this.editorMode = 'edit';
|
||||
this.focusEditor(100);
|
||||
@@ -762,8 +766,11 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
|
||||
extensionManager.addExtension(this.newExtensionData.url, function (response) {
|
||||
if (!response) {
|
||||
alert("Unable to register this extension. Make sure the link is valid and try again.");
|
||||
} else {
|
||||
this.newExtensionData.url = "";
|
||||
this.showNewExtensionForm = false;
|
||||
}
|
||||
});
|
||||
}.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
2
vendor/assets/javascripts/transpiled.js.map
vendored
2
vendor/assets/javascripts/transpiled.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user