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