Skip to content

Commit

Permalink
Add enableWebGL to the preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Apr 3, 2014
1 parent f57c693 commit 30ab878
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion web/default_preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ var DEFAULT_PREFERENCES = {
showPreviousViewOnLoad: true,
defaultZoomValue: '',
ifAvailableShowOutlineOnLoad: false,
enableHandToolOnLoad: false
enableHandToolOnLoad: false,
enableWebGL: false
};
16 changes: 14 additions & 2 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,20 @@ var PDFView = {
pageCountField: document.getElementById('pageCountField')
});

this.initialized = true;
container.addEventListener('scroll', function() {
self.lastScroll = Date.now();
}, false);

var initializedPromise = Promise.all([
Preferences.get('enableWebGL').then(function (value) {
PDFJS.disableWebGL = !value;
})
// TODO move more preferences and other async stuff here
]);

return initializedPromise.then(function () {
PDFView.initialized = true;
});
},

getPage: function pdfViewGetPage(n) {
Expand Down Expand Up @@ -1652,8 +1662,10 @@ var DocumentOutlineView = function documentOutlineView(outline) {
//#endif

function webViewerLoad(evt) {
PDFView.initialize();
PDFView.initialize().then(webViewerInitialized);
}

function webViewerInitialized() {
//#if (GENERIC || B2G)
var params = PDFView.parseQueryString(document.location.search.substring(1));
var file = 'file' in params ? params.file : DEFAULT_URL;
Expand Down

0 comments on commit 30ab878

Please sign in to comment.