mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Monitoring form for locale changes in CMSMain.Translatable.js
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92662 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b9041367bf
commit
371abfdd1d
@ -8,12 +8,20 @@
|
||||
return/** @lends ss.CMSMain.LangSelector */{
|
||||
onmatch: function() {
|
||||
var self = this;
|
||||
|
||||
// monitor form loading for any locale changes
|
||||
$('#Form_EditForm').bind('loadnewpage', function(e) {
|
||||
var newLocale = $(this).find(':input[name=Locale]').val();
|
||||
if(newLocale) self.val(newLocale);
|
||||
});
|
||||
|
||||
// whenever a new value is selected, reload the whole CMS in the new locale
|
||||
this.bind('change', function(e) {
|
||||
document.location = 'admin/?locale=' + $(e.target).val();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
@ -44,7 +52,7 @@
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
}(jQuery));
|
Loading…
Reference in New Issue
Block a user