editor: canvas - allow for resetting the container background
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 6 Aug 2014 13:47:54 +0000 (15:47 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 14 Aug 2014 14:26:14 +0000 (16:26 +0200)
src/editor/modules/documentCanvas/canvas/container.js
src/editor/modules/documentCanvas/canvas/container.less [new file with mode: 0644]
src/editor/modules/documentCanvas/documentCanvas.less

index 069c78a..663a159 100644 (file)
@@ -8,9 +8,11 @@ var $ = require('libs/jquery'),
 
 
 var Container = function(nodes, params, element) {
 
 
 var Container = function(nodes, params, element) {
+    params = params || {};
     _.extend(this, params);
     this.dom = this.dom || $('<div>');
     this.dom.addClass('canvas-container');
     _.extend(this, params);
     this.dom = this.dom || $('<div>');
     this.dom.addClass('canvas-container');
+    this.dom.toggleClass('reset-background', !!params.resetBackground);
     this.element = element;
 
     nodes.forEach(function(node) {
     this.element = element;
 
     nodes.forEach(function(node) {
diff --git a/src/editor/modules/documentCanvas/canvas/container.less b/src/editor/modules/documentCanvas/canvas/container.less
new file mode 100644 (file)
index 0000000..dc4a514
--- /dev/null
@@ -0,0 +1,5 @@
+.canvas-container {
+    .reset-background {
+        background-color: @white;
+    }
+}
index 3d335dc..9677691 100644 (file)
@@ -1,5 +1,6 @@
 @import 'nodes.less';
 @import 'canvas/canvas.less';
 @import 'nodes.less';
 @import 'canvas/canvas.less';
+@import 'canvas/container.less';
 @import 'canvas/documentElement.less';
 @import 'canvas/genericElement.less';
 @import 'canvas/gutter.less';
 @import 'canvas/documentElement.less';
 @import 'canvas/genericElement.less';
 @import 'canvas/gutter.less';