Add preference to automatically enable the Hand Tool when the viewer loads
This commit is contained in:
parent
4c9c43f82b
commit
42f9541081
@ -21,5 +21,6 @@
|
|||||||
var DEFAULT_PREFERENCES = {
|
var DEFAULT_PREFERENCES = {
|
||||||
showPreviousViewOnLoad: true,
|
showPreviousViewOnLoad: true,
|
||||||
defaultZoomValue: '',
|
defaultZoomValue: '',
|
||||||
ifAvailableShowOutlineOnLoad: false
|
ifAvailableShowOutlineOnLoad: false,
|
||||||
|
enableHandToolOnLoad: false
|
||||||
};
|
};
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* globals mozL10n, GrabToPan, PDFView, SecondaryToolbar */
|
/* globals mozL10n, GrabToPan, PDFView, Preferences, SecondaryToolbar */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -43,8 +43,15 @@ var HandTool = {
|
|||||||
});
|
});
|
||||||
if (toggleHandTool) {
|
if (toggleHandTool) {
|
||||||
toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
|
toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
|
||||||
|
|
||||||
|
window.addEventListener('localized', function (evt) {
|
||||||
|
Preferences.get('enableHandToolOnLoad').then(function (prefValue) {
|
||||||
|
if (prefValue) {
|
||||||
|
this.handTool.activate();
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
}.bind(this));
|
||||||
}
|
}
|
||||||
// TODO: Read global prefs and call this.handTool.activate() if needed.
|
|
||||||
},
|
},
|
||||||
|
|
||||||
toggle: function handToolToggle() {
|
toggle: function handToolToggle() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user