aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/image-controller.js
diff options
context:
space:
mode:
authorPierre Frisch2011-12-22 07:25:50 -0800
committerValerio Virgillito2012-01-27 11:18:17 -0800
commitb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch)
tree0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/controllers/elements/image-controller.js
parent2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff)
downloadninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/controllers/elements/image-controller.js')
-rw-r--r--js/controllers/elements/image-controller.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/js/controllers/elements/image-controller.js b/js/controllers/elements/image-controller.js
new file mode 100644
index 00000000..5abce13e
--- /dev/null
+++ b/js/controllers/elements/image-controller.js
@@ -0,0 +1,41 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 ElementController = require("js/controllers/elements/element-controller").ElementController;
9
10exports.ImageController = Montage.create(ElementController, {
11
12 getProperty: {
13 value: function(el, prop) {
14 switch(prop) {
15 case "src":
16 return el.getAttribute(prop);
17 break;
18 case "alt":
19 return el.getAttribute(prop);
20 break;
21 default:
22 return ElementController.getProperty(el, prop);
23 }
24 }
25 },
26
27 setProperty: {
28 value: function(el, p, value) {
29 switch(p) {
30 case "src":
31 el.setAttribute(p, value);
32 break;
33 case "alt":
34 el.setAttribute(p, value);
35 break;
36 default:
37 ElementController.setProperty(el, p, value);
38 }
39 }
40 }
41}); \ No newline at end of file