Created
July 2, 2014 03:12
-
-
Save cjcjameson/2562850e989a2d602a74 to your computer and use it in GitHub Desktop.
widget
This file contains hidden or 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
$(function() { | |
previewView = new PreviewWidget.View; | |
previewController = new PreviewWidget.Controller(previewView); | |
previewController.initializeEventBindings(); | |
}); | |
var PreviewWidget = { | |
View: function(){ | |
this.updatePreview = function() { | |
formText = $('#train_name')[0].value | |
$('.preview_window')[0].innerHTML = formText | |
}; | |
}, | |
Controller: function(previewView) { | |
this.initializeEventBindings = function() { | |
$('#train_name').on('keyup', previewView.updatePreview); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment