mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
Replace trimLeft/trimRight functions (not supported by IE).
This commit is contained in:
@@ -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')];
|
||||
|
||||
Reference in New Issue
Block a user