mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-23 14:41:44 +00:00
add edit modal & fix some features
This commit is contained in:
18
src/directives/btn-edit-snippet.js
Normal file
18
src/directives/btn-edit-snippet.js
Normal file
@@ -0,0 +1,18 @@
|
||||
angular.module('codexen.directives')
|
||||
.directive('btnEditSnippet', function (editSnippetModal, $rootScope) {
|
||||
return {
|
||||
scope:{
|
||||
snippet: '=btnEditSnippet'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
editSnippetModal.open(scope.snippet)
|
||||
.result.then(function (snippet) {
|
||||
$rootScope.$broadcast('snippetUpdated', snippet)
|
||||
}, function () {
|
||||
console.log('edit snippet modal dismissed')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user