BUGFIX Fixed url_segment undefined error in CMSMain.EditForm, assuming

*all* title fields have a URLSegment field associated with them, which
they don't.
This commit is contained in:
Sean Harvey 2012-05-22 14:04:20 +12:00
parent 4286bf0844
commit b0a026b4c6

View File

@ -31,17 +31,19 @@
self._addActions(); self._addActions();
this.bind('change', function(e) { if(url_segment.length > 0) {
var title = self.val(); this.bind('change', function(e) {
// Criteria for defining a "new" page var title = self.val();
if ( (url_segment.val().indexOf("new") == 0) && live_url_segment.val() == "" ) { // Criteria for defining a "new" page
self.updateRelatedFields(title); if ((url_segment.val().indexOf('new') == 0) && live_url_segment.val() == '') {
self.updateURLSegment(title); self.updateRelatedFields(title);
} else { self.updateURLSegment(title);
$('.update', self.parent()).show(); } else {
} $('.update', self.parent()).show();
self.updatePanelLabels(title); }
}); self.updatePanelLabels(title);
});
}
this._super(); this._super();
}, },