<abstract> new Controller()
Defines controller abstract class.
Example
WebPDF.Toolbar.getRegistry().registerController('custom', {
methods:{
initialize: function(){
var self = this;
_super_.initialize();
this.watch(function(){
return WebPDF.ViewerInstance.isDocModified();
}, function(isModified){
if(isModified) {
self.enableComponents();
} else {
self.disableComponents();
}
self.updateComponentsPermission();
});
},
handle: function(component, config, data){
console.info('handle', data);
}
}
})
Methods
-
disableComponents()
-
Disable all components attached to this controller;
-
enableComponents()
-
Enable all components attached to this controller;
-
handle(component, config, data)
-
toolbar component event handler.
Parameters:
Name Type Description componentWebPDF.Toolbar.Component event
configWebPDF.Toolbar.Configuration dataobject -
initialize()
-
Called after components have been mounted. You should listen to application status change events and update component's status here.
-
watch(watchFor, listener)
-
Parameters:
Name Type Description watchForfunction Function that is evaluated on each cycle. A change in the return value triggers a call to the
listenerlistenerfunction Callback caled whenever the value of key
watchForchanges.