Explorar el Código

Remove table styles transform

master
Igor_Budimski hace 4 años
padre
commit
e24c89122d

+ 1
- 0
src/parameters/parameters.js Ver fichero

@@ -9,6 +9,7 @@ const parameters = () =>
new Param("br-removerow",["table"]),
new Param("br-removeheader",["table"]),
new Param("br-removecolumn",["table"]),
new Param("br-removetablestyles",["table"]),
new Param("br-hide",["table","p","span"]),
new Param("br-color",["h1","p","h4"]),
new Param("br-bordercolor",["table","div"])

+ 20
- 0
src/transformations/remove-table-style.js Ver fichero

@@ -0,0 +1,20 @@
import {Transform} from "./transform";
import $ from "jquery";

export class RemoveTableStylesTransform extends Transform {
constructor(object){
super();
this.object = object;
this.class = this.object.className;
}

execute(){
$(this.object).removeClass();
//$(this.object).removeAttr( 'style' );
}

rolback(){
$(this.object).addClass(this.class);
//$(this.object).addAttr( 'style' );
}
}

+ 3
- 0
src/transforms-factory.js Ver fichero

@@ -5,6 +5,7 @@ import { RemoveTableColumnTransform } from "./transformations/remove-table-colum
import { RemoveTableRowTransform } from "./transformations/remove-table-row-transform";
import { ShowNumberRowsTransformation } from "./transformations/show-number-rows-transformation";
import { BorderColorTransform } from "./transformations/border-color-transformation/border-color-transformation";
import { RemoveTableStylesTransform } from "./transformations/remove-table-style";

export class TransformsFactory{
produce(code,object,value)
@@ -23,6 +24,8 @@ export class TransformsFactory{
return new RemoveTableRowTransform(object,value);
} else if(code === ("br-removeheader")){
return new RemoveTableRowTransform(object,0);
} else if(code === ("br-removetablestyles")){
return new RemoveTableStylesTransform(object,value);
} else if(code === ("br-shownumberrows")){
return new ShowNumberRowsTransformation(object,value);
} else if(code === ("br-bordercolor")){

Cargando…
Cancelar
Guardar