mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11:54 +08:00
Merge pull request #77 from grotr/master
Add disableSelection to stop highlighting
This commit is contained in:
+15
-1
@@ -85,6 +85,8 @@ var Engine = {
|
||||
if(Engine.isMobile()) {
|
||||
window.location = 'mobileWarning.html';
|
||||
}
|
||||
|
||||
Engine.disableSelection();
|
||||
|
||||
if(this.options.state != null) {
|
||||
window.State = this.options.state;
|
||||
@@ -248,6 +250,7 @@ var Engine = {
|
||||
string64 = string64.replace(/\s/g, '');
|
||||
string64 = string64.replace(/\./g, '');
|
||||
string64 = string64.replace(/\n/g, '');
|
||||
Engine.enableSelection();
|
||||
Events.startEvent({
|
||||
title: 'Export',
|
||||
scenes: {
|
||||
@@ -257,7 +260,8 @@ var Engine = {
|
||||
buttons: {
|
||||
'done': {
|
||||
text: 'got it',
|
||||
nextScene: 'end'
|
||||
nextScene: 'end',
|
||||
onChoose: Engine.disableSelection
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,6 +569,16 @@ var Engine = {
|
||||
Engine.activeModule.swipeDown(e);
|
||||
}
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
document.onselectstart = function() {return false;} // this is for IE
|
||||
document.onmousedown = function() {return false;} // this is for the rest
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
document.onselectstart = function() {return true;}
|
||||
document.onmousedown = function() {return true;}
|
||||
},
|
||||
|
||||
handleStateUpdates: function(e){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user