Created
April 12, 2018 06:45
-
-
Save nathan5x-zz/655804d9d06586f1f6c30741826b3ad1 to your computer and use it in GitHub Desktop.
Create UI Component in HTML, CSS, and JS like it is in Adobe Flex & ActionScript
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
LoginControl.prototype = { | |
loginInitialize: function(placeHolder, name) { | |
var currentInstance = this; | |
var view = currentInstance.loginUI; | |
currentInstance.name = name; | |
view.children('.login-form').submit(function(event) { | |
if(currentInstance.loginData.username === '' || currentInstance.loginData.password === '') { | |
alert (currentInstance.name + ': Input fields should not be empty'); | |
} else { | |
LoginAdapter.login(currentInstance); | |
} | |
event.preventDefault(); | |
}); | |
view.find('input[name=username]').change( function() { | |
currentInstance.loginData.username = $(this).val(); | |
}); | |
view.find('input[name=password]').change( function() { | |
currentInstance.loginData.password = $(this).val(); | |
}); | |
placeHolder.append(view); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment