working on date picker; conflicts with ids

This commit is contained in:
Tom Giannattasio
2012-11-27 09:01:58 -05:00
parent 3d9961f874
commit 5dd90aa9cb
3 changed files with 11 additions and 5 deletions

View File

@@ -4,9 +4,7 @@
<div class="row">
<label class="inline-label">Date:</label>
<!-- TODO replace w/ date widget and actual date (problem is that persisted version is "Month day" not an actual date obj -->
<div class="datepair">
<input type="text" class="date" id="date-entry" value="<%= updateModel.get('date') %>"></input>
</div>
<input type="text" class="date" id="date-entry" value="<%= updateModel.get('date') %>">
</div>
<div class="row">
<textarea class="new-update-content text-editor"><%= updateModel.get('content') %></textarea>

View File

@@ -5,7 +5,7 @@
if (typeof window.templateLoader == 'function') return;
var templateLoader = {
templateVersion: "0.0.4",
templateVersion: "0.0.3",
templates: {},
loadRemoteTemplate: function(templateName, filename, callback) {
if (!this.templates[templateName]) {

View File

@@ -53,6 +53,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
$(updateEle).append(newEle);
});
this.$el.find(".new-update-form").hide();
this.$el.find('.date').datepicker({ 'dateFormat': 'MM d' });
return this;
},
@@ -64,7 +65,14 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
var newForm = this.template({ updateModel : newModel });
var updateEle = this.$el.find("#course-update-list");
$(updateEle).prepend(newForm);
$(newForm).find(".new-update-form").show();
// TODO: remove the id on the datepicker field
// this is causing conflicts with the datepicker widget
$('.date').datepicker('destroy');
$('.date').datepicker({ 'dateFormat': 'MM d' });
},
onSave: function(event) {