mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11:54 +08:00
Styling on the language dropdown
This commit is contained in:
+14
-1
@@ -1,5 +1,5 @@
|
||||
/* Fonts */
|
||||
body, .tooltip {
|
||||
body, .tooltip, select.menuBtn {
|
||||
font-family: "Times New Roman", Times, serif;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
@@ -65,6 +65,19 @@ div#header {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.select-wrap {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
select.menuBtn {
|
||||
color: #666;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
margin: -1px -20px 0 0;
|
||||
}
|
||||
|
||||
.menu span:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
+24
-10
@@ -1,4 +1,5 @@
|
||||
var Engine = {
|
||||
(function() {
|
||||
var Engine = window.Engine = {
|
||||
|
||||
/* TODO *** MICHAEL IS A LAZY BASTARD AND DOES NOT WANT TO REFACTOR ***
|
||||
* Here is what he should be doing:
|
||||
@@ -111,13 +112,16 @@ var Engine = {
|
||||
.addClass('menu')
|
||||
.appendTo('body');
|
||||
|
||||
var selectWrap = $('<span>')
|
||||
.addClass('select-wrap')
|
||||
.appendTo(menu);
|
||||
$('<select>')
|
||||
.addClass('menuBtn')
|
||||
.append($('<option>').text("choose your language"))
|
||||
.append($('<option>').text("English").val("en"))
|
||||
.append($('<option>').text("Français").val("fr"))
|
||||
.append($('<option>').text("language."))
|
||||
.append($('<option>').text("english").val("en"))
|
||||
.append($('<option>').text("français").val("fr"))
|
||||
.change(Engine.switchLanguage)
|
||||
.appendTo(menu);
|
||||
.appendTo(selectWrap);
|
||||
|
||||
$('<span>')
|
||||
.addClass('lightsOff menuBtn')
|
||||
@@ -609,13 +613,13 @@ var Engine = {
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
document.onselectstart = function() {return false;}; // this is for IE
|
||||
document.onmousedown = function() {return false;}; // this is for the rest
|
||||
document.onselectstart = eventNullifier; // this is for IE
|
||||
document.onmousedown = eventNullifier; // this is for the rest
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
document.onselectstart = function() {return true;};
|
||||
document.onmousedown = function() {return true;};
|
||||
document.onselectstart = eventPassthrough;
|
||||
document.onmousedown = eventPassthrough;
|
||||
},
|
||||
|
||||
handleStateUpdates: function(e){
|
||||
@@ -637,7 +641,17 @@ var Engine = {
|
||||
localStorage.lang = lang;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function eventNullifier(e) {
|
||||
return $(e.target).hasClass('menuBtn');
|
||||
}
|
||||
|
||||
function eventPassthrough(e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
//create jQuery Callbacks() to handle object events
|
||||
$.Dispatch = function( id ) {
|
||||
|
||||
Reference in New Issue
Block a user