mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Merge pull request '[PDF forms] Add requestRoles method in api' (#334) from fix/request-roles into hotfix/v8.3.2
This commit is contained in:
@ -827,6 +827,13 @@
|
||||
});
|
||||
};
|
||||
|
||||
var _requestRoles = function(data) {
|
||||
_sendCommand({
|
||||
command: 'requestRoles',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
var _processMouse = function(evt) {
|
||||
var r = iframe.getBoundingClientRect();
|
||||
var data = {
|
||||
@ -913,7 +920,8 @@
|
||||
setRequestedSpreadsheet: _setRequestedSpreadsheet,
|
||||
setReferenceSource: _setReferenceSource,
|
||||
openDocument: _openDocumentFromBinary,
|
||||
startFilling: _startFilling
|
||||
startFilling: _startFilling,
|
||||
requestRoles: _requestRoles
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -165,6 +165,10 @@ if (window.Common === undefined) {
|
||||
|
||||
'startFilling': function(data) {
|
||||
$me.trigger('startfilling', data);
|
||||
},
|
||||
|
||||
'requestRoles': function(data) {
|
||||
$me.trigger('requestroles', data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -53,6 +53,7 @@ define([
|
||||
sdkViewName : '#id_main',
|
||||
|
||||
initialize: function () {
|
||||
Common.Gateway.on('requestroles', _.bind(this.onRequestRoles, this));
|
||||
},
|
||||
onLaunch: function () {
|
||||
this._state = {
|
||||
@ -61,7 +62,8 @@ define([
|
||||
formCount: 0,
|
||||
formAdded: undefined,
|
||||
formRadioAdded: undefined,
|
||||
pageCount: 1
|
||||
pageCount: 1,
|
||||
needToStartFilling: undefined
|
||||
};
|
||||
},
|
||||
|
||||
@ -88,6 +90,7 @@ define([
|
||||
Common.NotificationCenter.on('forms:close-help', _.bind(this.closeHelpTip, this));
|
||||
Common.NotificationCenter.on('forms:show-help', _.bind(this.showHelpTip, this));
|
||||
Common.NotificationCenter.on('forms:request-fill', _.bind(this.requestStartFilling, this));
|
||||
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||
return this;
|
||||
},
|
||||
|
||||
@ -733,6 +736,21 @@ define([
|
||||
value = this._state.pageCount;
|
||||
this.api && this.api.goToPage(value-1);
|
||||
}
|
||||
},
|
||||
|
||||
onRequestRoles: function(tab) {
|
||||
if (this._isDocReady)
|
||||
this.requestStartFilling();
|
||||
else
|
||||
this._state.needToStartFilling = true;
|
||||
},
|
||||
|
||||
onDocumentReady: function(tab) {
|
||||
this._isDocReady = true;
|
||||
if (this._state.needToStartFilling) {
|
||||
this._state.needToStartFilling = false;
|
||||
this.requestStartFilling();
|
||||
}
|
||||
}
|
||||
|
||||
}, DE.Controllers.FormsTab || {}));
|
||||
|
||||
Reference in New Issue
Block a user