summaryrefslogtreecommitdiff
path: root/templates/project/widgets/image
diff options
context:
space:
mode:
Diffstat (limited to 'templates/project/widgets/image')
-rw-r--r--templates/project/widgets/image/image.coffee9
-rw-r--r--templates/project/widgets/image/image.html1
-rw-r--r--templates/project/widgets/image/image.scss13
3 files changed, 23 insertions, 0 deletions
diff --git a/templates/project/widgets/image/image.coffee b/templates/project/widgets/image/image.coffee
new file mode 100644
index 0000000..c3892c0
--- /dev/null
+++ b/templates/project/widgets/image/image.coffee
@@ -0,0 +1,9 @@
+class Dashing.Image extends Dashing.Widget
+
+ ready: ->
+ # This is fired when the widget is done being rendered
+
+ onData: (data) ->
+ # Handle incoming data
+ # You can access the html node of this widget with `@node`
+ # Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
diff --git a/templates/project/widgets/image/image.html b/templates/project/widgets/image/image.html
new file mode 100644
index 0000000..41a88eb
--- /dev/null
+++ b/templates/project/widgets/image/image.html
@@ -0,0 +1 @@
+<img data-bind-src="image | prepend '/assets'" data-bind-width="width"/>
diff --git a/templates/project/widgets/image/image.scss b/templates/project/widgets/image/image.scss
new file mode 100644
index 0000000..0b1a316
--- /dev/null
+++ b/templates/project/widgets/image/image.scss
@@ -0,0 +1,13 @@
+// ----------------------------------------------------------------------------
+// Sass declarations
+// ----------------------------------------------------------------------------
+$background-color: #4b4b4b;
+
+// ----------------------------------------------------------------------------
+// Widget-image styles
+// ----------------------------------------------------------------------------
+.widget-image {
+
+ background-color: $background-color;
+
+}