Link to browser text editor
I have list of images which i would like to add inside the editor. I have tried tons of different things, mostly with custom toolbar which adding image. Is there a way to trigger that outside taOptions
? My latest try:
taRegisterTool('uploadImage', {
iconclass: 'icon-picture-o',
action: function(){
var self = this;
myPhotos.addImage = function() {
if (myPhotos.selectedToAdd) self.$editor().wrapSelection('insertImage', myPhotos.selectedToAdd.url, true);
}
},
onElementSelect: onElementSelect
});
Where myPhoto is factory and function addImage is called when user click on the image. Toolbar is called when user open list of images. This work for the first time, but on second image click it's not adding the image even if function addImage get called.
Edit: i have now all repeat inside taRegisterTool.
taRegisterTool('allImages', {
display: '<img ng-src="{{photo.url}}" class="nw-photofromgal" ng-repeat="photo in options" ng-click="action($event, photo)">',
action: function(event, photo){
console.log(event);
console.log(photo);
this.$editor().wrapSelection('insertImage', photo.url, true);
},
options: myPhotos.images
});
But still i have the issue of adding photo, ng-click is not working, i am getting a promise as param.