Expose setVisualZoomLevelLimits on webContents and <web-view>

This commit is contained in:
Kevin Sawicki 2016-11-22 08:07:55 -08:00
Родитель 756a338b05
Коммит 9a5df9da41
3 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -691,7 +691,22 @@ Sends a request to get current zoom level, the `callback` will be called with
* `minimumLevel` Number * `minimumLevel` Number
* `maximumLevel` Number * `maximumLevel` Number
Sets the maximum and minimum zoom level. **Deprecated:** Call `setVisualZoomLevelLimits` instead to set the visual zoom
level limits. This method will be removed in Electron 2.0.
#### `contents.setVisualZoomLevelLimits(minimumLevel, maximumLevel)`
* `minimumLevel` Number
* `maximumLevel` Number
Sets the maximum and minimum pinch-to-zoom level.
#### `contents.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)`
* `minimumLevel` Number
* `maximumLevel` Number
Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
#### `contents.undo()` #### `contents.undo()`

Просмотреть файл

@ -101,8 +101,10 @@ WebContents.prototype.sendToAll = function (channel, ...args) {
const webFrameMethods = [ const webFrameMethods = [
'insertText', 'insertText',
'setLayoutZoomLevelLimits', 'setLayoutZoomLevelLimits',
'setVisualZoomLevelLimits',
'setZoomFactor', 'setZoomFactor',
'setZoomLevel', 'setZoomLevel',
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
'setZoomLevelLimits' 'setZoomLevelLimits'
] ]
const webFrameMethodsWithResult = [ const webFrameMethodsWithResult = [

Просмотреть файл

@ -391,8 +391,10 @@ var registerWebViewElement = function () {
'send', 'send',
'sendInputEvent', 'sendInputEvent',
'setLayoutZoomLevelLimits', 'setLayoutZoomLevelLimits',
'setVisualZoomLevelLimits',
'setZoomFactor', 'setZoomFactor',
'setZoomLevel', 'setZoomLevel',
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
'setZoomLevelLimits' 'setZoomLevelLimits'
] ]