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) {
Blockly.JavaScript['text_trim'] = function(block) {
// Trim spaces.
var OPERATORS = {
'LEFT': '.trimLeft()',
'RIGHT': '.trimRight()',
'LEFT': ".replace(/^[\\s\\xa0]+/, '')",
'RIGHT': ".replace(/[\\s\\xa0]+$/, '')",
'BOTH': '.trim()'
};
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