Styling on the language dropdown

This commit is contained in:
Michael
2014-05-19 13:15:46 -04:00
parent c6ccad177a
commit 81d8129f0f
2 changed files with 634 additions and 607 deletions
+14 -1
View File
@@ -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;
} }
+23 -9
View File
@@ -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){
@@ -639,6 +643,16 @@ var Engine = {
} }
}; };
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 ) {
var callbacks, var callbacks,