ninjs 0.13.4 → 0.13.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,67 +0,0 @@
1
- (function($) {
2
-
3
- NinjsModule.prototype.elements = function(elements, force) {
4
- var self = this;
5
-
6
- unless(is_defined(force), function() {
7
- force = false;
8
- });
9
-
10
- if (is_string(elements)) {
11
- var key = elements;
12
-
13
- try {
14
- if (is_undefined(self.dom[key])) {
15
- throw new SyntaxError("NinjsModule.elements('" + key + "'): " + self.name + ".dom." + key + " is undefined");
16
- }
17
-
18
- if (is_string(self.dom[key])) {
19
- var selection = $(self.dom[key]);
20
-
21
- unless(selection.length === 0, function() {
22
- return self.dom[key] = selection;
23
- }, function() {
24
- return self.dom[key];
25
- });
26
- }
27
- else {
28
- if (self.dom[key].length === 0 || force) {
29
-
30
- var return_obj = undefined;
31
-
32
- if (is_string(force)) {
33
- var selector = self.dom[key].selector;
34
- self.dom[key] = $(force).find(selector);
35
- self.dom[key].selector = selector;
36
-
37
- return_obj = self.dom[key];
38
- }
39
-
40
- var selection = $(self.dom[key].selector);
41
- unless(selection.length === 0, function() {
42
- return_obj = selection;
43
- });
44
-
45
- return return_obj;
46
- }
47
- else {
48
- return self.dom[key];
49
- }
50
- }
51
- }
52
- catch(error) {
53
- alert(error.message);
54
- }
55
- }
56
- else if (is_typeof(Object, elements)){
57
- self.call_on_ready(function() {
58
- for(var key in elements) {
59
- if (elements.hasOwnProperty(key)) {
60
- self.dom[key] = elements[key];
61
- }
62
- }
63
- });
64
- }
65
- };
66
-
67
- })(jQuery);