-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use angular bootstrap modal for insert link #419
Comments
Hi, two things you need for this are the actions promise and to specifically return false. Looks like this: taRegisterTool('insertLink',{
tooltiptext: taTranslations.insertLink.tooltip,
iconclass: 'icon-link',
action: function(promise, restoreSelection){
... // removed for brevity
//define result modal , when user complete result information
insertLinkmodalScope.modalInstance.result.then(function(result){
if (result.isOk) {
restoreSelection(); // selection will be lost in the modal interaction - you need to have rangy core and rangy saveselection enabled, or the minified rangy bundle from the repo
that.$editor().wrapSelection('createLink', result.webaddress, true);
promise.resolve(); // this tells the editor you're done and bindings should be updated now
}
});
return false;
},
activeState: ....,
onElementSelect: ....
}); |
Using modals end to end, how would the modal work in the onElementSelect block? I tried this: reLinkButton.on('click', function(event){
event.preventDefault();
var modalInstance = $modal.open({
templateUrl : '/templates/dialog/linkMaker.html',
controller : 'linkMakerDlgCtrl',
resolve : {
// variables here ...
}
}
});
modalInstance.result.then(function (link) {
$element.attr('href', 'http://' + link.ref);
editorScope.updateTaBindtaTextElement();
}, function () { $log.debug('Modal dismissed'); });
editorScope.hidePopover();
}); Does it also need the promise and return false? The problem with the above appears to be with |
mangrovestudios please create a new issue. |
A quick question on your code, @atahani How or where does the $modal service get injected? Thanks so much! |
To answer my own question, if anyone was wondering, it seems to work by injecting $modal in the $run function. |
Hi @SimeonC i want your help i am also facing same problem but its not working with modal. Do you have any demo of this solved issue. |
@deepak-manwal did you try injecting |
Hi @SimeonC, @atahani do you see why - this.$editor(). throws an undefined error inside mddialog resolve (.then) unlike the above mentioned modal example. Thanks. taRegisterTool('insertImage1',{
};
|
i want use from angularjs bootstrap modal for insert link , so in
textAngularSetup.js
file include$modal
as dependency, and use it in insertLink action function:when i debug code in chrome, find out the command executed but didn't affect in HTML editor.
is any way to use from bootstrap modal for inset link ?
The text was updated successfully, but these errors were encountered: