Add equation selector

This commit is contained in:
ThemeBoy
2013-11-26 03:15:06 +11:00
parent 7aeec083b8
commit 639f4b86da
4 changed files with 149 additions and 59 deletions

View File

@@ -64,12 +64,16 @@ jQuery(document).ready(function($){
}
// Equation selector
$('.sp-equation-selector select').change(function() {
$('.sp-equation-selector select:last').change(function() {
$(this).siblings().change(function() {
if($(this).val() == '') $(this).remove();
}).find('option:first').text($(this).attr('data-remove-text'));
if($(this).val() != '') {
$(this).before($(this).clone().val($(this).val())).val('').siblings().change(function() {
if($(this).val() == '') $(this).remove();
}).find('option:first').text($(this).attr('data-remove-text'));
$(this).before($(this).clone().val($(this).val())).val('');
}
});
// Trigger equation selector
$('.sp-equation-selector select:last').change();
});