-
-
Save orlybg/28a82b42ab86a85d96f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DbDiff = (function() { | |
var foo; | |
var hostList; | |
var $hostSelect1; | |
var $hostSelect2; | |
function init() { | |
console.log('-------- INIT --------'); | |
this.foo = 'bar'; | |
this.hostList = ['tuna.letstalk.com', 'foo.bar']; | |
this.$hostSelect1 = $('#hostSelect1'); | |
this.$hostSelect2 = $('#hostSelect2'); | |
}; | |
function enterHost() { | |
console.log('----------------------------'); | |
}; | |
function getHostList() { | |
console.log('hosts1', this.$hosts1 ); | |
return this.hostList; | |
}; | |
function populateHostList() { | |
DbDiff = this; | |
$arrHosts = $('#hostSelect1, #hostSelect2'); | |
$.each($arrHosts, function(idx, host) { | |
$.each(DbDiff.getHostList(), function(key, value) { | |
$host = $(host); | |
$host.append($("<option></option>").attr("value", value).text(value)); | |
}); | |
}); | |
}; | |
return { | |
init : init, | |
enterHost : enterHost, | |
getHostList : getHostList, | |
populateHostList : populateHostList, | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment