javascript - Angular-redactor: How to setup blur callback? -
the situation:
i using angular-redactor editor app.
everything working fine except 1 thing. need fire blur event ask confirmation user in case want leave page without saving.
the code
this redactor textarea:
<textarea cols="30" rows="30" ng-model="body" ng-blur="confirmation_email_exit()"redactor="     {        minheight: 370,       focus: true,       plugins: ['fontcolor', 'table', 'fullscreen', 'counter', 'fontfamily'],      }"> </textarea> this example of global options working:
app.config(function(redactoroptions) {      redactoroptions.buttons = ['formatting', '|', 'bold', 'italic'];  }); the question:
how can fire blur event angular-redactor?
i have call in view or setup global option?
just use redactor's blurcallback, , can use both in view , in redactoroptions:
<textarea cols="30" rows="30" ng-model="body" redactor="     {        minheight: 370,       focus: true,       plugins: ['fontcolor', 'table', 'fullscreen', 'counter', 'fontfamily'],       blurcallback: function(){confirmation_email_exit()},     }"> </textarea> or
app.config(function(redactoroptions) {     redactoroptions.buttons = ['formatting', '|', 'bold', 'italic'];    redactoroptions.blurcallback = function(){confirmation_email_exit()};  }); 
Comments
Post a Comment