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

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