WebTextEditor/Content/js/services/text.service.js
/**
         * Removes a characters from the text structure.
         * @param {array} values - character values.
         */
Removes a characters from the text structure.
@param {array} values - character values.
Removes a characters from the text structure . @param { array } values - character values .
function removeCharacters(values) {
            if (!text) {
                deferredOps.concat(values.map(function(value) {
                    return ["del", value.id];
                }));
                return;
            }
            var ops = values.reduce(function(result, value) {
                var op = text.applyOp(["del", value.id]);
                if (op) {
                    var last = result.length > 0 ? result[result.length - 1] : undefined;
                    if (last == undefined || op.index !== last.index) {
                        last = { index: op.index, length: 0 };
                        result.push(last);
                    }
                    last.length++;
                }
                return result;
            }, []);
            ops.forEach(function(op) {
                inputService.replaceText(input, op.index, op.index + op.length, "");
            });
            $scope.$broadcast("elastic:adjust");
        }
function removeCharacters ( values ) { if ( ! text ) { deferredOps . concat ( values . map ( function ( value ) { return [ "del" , value . id ] ; } ) ) ; return ; } var ops = values . reduce ( function ( result , value ) { var op = text . applyOp ( [ "del" , value . id ] ) ; if ( op ) { var last = result . length > 0 ? result [ result . length - 1 ] : undefined ; if ( last == undefined || op . index !== last . index ) { last = { index : op . index , length : 0 } ; result . push ( last ) ; } last . length ++ ; } return result ; } , [ ] ) ; ops . forEach ( function ( op ) { inputService . replaceText ( input , op . index , op . index + op . length , "" ) ; } ) ; $scope . $broadcast ( "elastic:adjust" ) ; }
Removes a characters from the text structure.
Removes a characters from the text structure .