/
button.module.js
114 lines (93 loc) · 3.21 KB
/
button.module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
(function() {
if (!this.require) {
var modules = {}, cache = {};
var require = function(name, root) {
var path = expand(root, name), indexPath = expand(path, './index'), module, fn;
module = cache[path] || cache[indexPath];
if (module) {
return module;
} else if (fn = modules[path] || modules[path = indexPath]) {
module = {id: path, exports: {}};
cache[path] = module.exports;
fn(module.exports, function(name) {
return require(name, dirname(path));
}, module);
return cache[path] = module.exports;
} else {
throw 'module ' + name + ' not found';
}
};
var expand = function(root, name) {
var results = [], parts, part;
// If path is relative
if (/^\.\.?(\/|$)/.test(name)) {
parts = [root, name].join('/').split('/');
} else {
parts = name.split('/');
}
for (var i = 0, length = parts.length; i < length; i++) {
part = parts[i];
if (part == '..') {
results.pop();
} else if (part != '.' && part != '') {
results.push(part);
}
}
return results.join('/');
};
var dirname = function(path) {
return path.split('/').slice(0, -1).join('/');
};
this.require = function(name) {
return require(name, '');
};
this.require.define = function(bundle) {
for (var key in bundle) {
modules[key] = bundle[key];
}
};
this.require.modules = modules;
this.require.cache = cache;
}
return this.require;
}).call(this);
this.require.define({"app/controllers/elements/button":function(exports, require, module){(function() {
var Background, Button, Color, Element,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
Element = require('../element');
Color = require('app/models/properties/color');
Background = require('app/models/properties/background');
Button = (function(_super) {
__extends(Button, _super);
Button.name = 'Button';
function Button() {
return Button.__super__.constructor.apply(this, arguments);
}
Button.prototype.events = {
'resize.element': 'syncLineHeight'
};
Button.prototype.defaults = function() {
var result;
return result = {
width: 100,
height: 40,
textAlign: 'center',
lineHeight: 40,
borderRadius: 5,
borderWidth: 1,
borderStyle: 'solid',
borderColor: new Color(166, 166, 166),
backgroundImage: [new Background.LinearGradient(new Background.Position(270), [new Background.ColorStop(new Color.White, 0), new Background.ColorStop(new Color.White, 30), new Background.ColorStop(new Color(242, 242, 242), 100)])]
};
};
Button.prototype.syncLineHeight = function() {
return this.set({
lineHeight: this.get('height')
});
};
return Button;
})(Element);
module.exports = Button;
}).call(this);
;}});