Commit 0d6a3bf9 authored by Neil Fraser's avatar Neil Fraser

Replace trimLeft/trimRight functions (not supported by IE).

parent adc1c5a3
...@@ -216,8 +216,8 @@ Blockly.JavaScript['text_changeCase'] = function(block) { ...@@ -216,8 +216,8 @@ Blockly.JavaScript['text_changeCase'] = function(block) {
Blockly.JavaScript['text_trim'] = function(block) { Blockly.JavaScript['text_trim'] = function(block) {
// Trim spaces. // Trim spaces.
var OPERATORS = { var OPERATORS = {
'LEFT': '.trimLeft()', 'LEFT': ".replace(/^[\\s\\xa0]+/, '')",
'RIGHT': '.trimRight()', 'RIGHT': ".replace(/[\\s\\xa0]+$/, '')",
'BOTH': '.trim()' 'BOTH': '.trim()'
}; };
var operator = OPERATORS[block.getFieldValue('MODE')]; var operator = OPERATORS[block.getFieldValue('MODE')];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment