-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (32 loc) · 842 Bytes
/
index.js
File metadata and controls
38 lines (32 loc) · 842 Bytes
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
/**
* @author Gilles Coomans <gilles.coomans@gmail.com>
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module);
}
define(['require', 'deepjs/deep'], function(require, deep) {
'use strict';
deep.jquery = deep.jquery || {};
deep.jquery.set = function(jq) {
deep.Promise.context.$ = jq;
};
deep.$ = function(selector) {
if (!selector)
return deep.Promise.context.$;
return deep.Promise.context.$(selector);
};
deep.jquery.upattr = function(object, selector) {
deep.$(selector).each(function() {
for (var i in object)
deep.Promise.context.$(this).attr(i, object[i]);
});
};
deep.jquery.bottomattr = function(object, selector) {
deep.$(selector).each(function() {
for (var i in object)
if (!$(this).attr(i))
$(this).attr(i, object[i]);
});
};
return deep.jquery;
});