Skip to content

Commit

Permalink
Math: Fix prefix/suffic option names & processing. Fixes #1305
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Nov 26, 2016
1 parent c83b191 commit 0686e55
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/widgets/widget-math.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
prev = $cell.html(),
mask = $cell.attr( 'data-' + wo.math_data + '-mask' ) || wo.math_mask,
target = $cell.attr( 'data-' + wo.math_data + '-target' ) || '',
result = ts.formatMask( mask, value, wo.math_wrapPrefix, wo.math_wrapSuffix );
result = ts.formatMask( mask, value, wo.math_prefix, wo.math_suffix );
if (target) {
$el = $cell.find(target);
if ($el.length) {
Expand Down Expand Up @@ -403,8 +403,7 @@
start = mask.search( /[0-9\-\+#]/ ),
tmp = start > 0 ? mask.substring( 0, start ) : '',
prefix = tmp;

if ( start > 0 && tmpPrefix ) {
if ( tmpPrefix ) {
if ( /\{content\}/.test( tmpPrefix || '' ) ) {
prefix = ( tmpPrefix || '' ).replace( /\{content\}/g, tmp || '' );
} else {
Expand All @@ -418,7 +417,7 @@
index += ( mask.substring( index, index + 1 ) === '.' ) ? 1 : 0;
tmp = end > 0 ? mask.substring( index, len ) : '';
suffix = tmp;
if ( tmp !== '' && tmpSuffix ) {
if ( tmpSuffix ) {
if ( /\{content\}/.test( tmpSuffix || '' ) ) {
suffix = ( tmpSuffix || '' ).replace( /\{content\}/g, tmp || '' );
} else {
Expand Down

0 comments on commit 0686e55

Please sign in to comment.