This repository was archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathindex.js
More file actions
52 lines (40 loc) · 1.42 KB
/
index.js
File metadata and controls
52 lines (40 loc) · 1.42 KB
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
/*
* Copyright (c) 2011-2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
/**
Binder for Mojito
Each mojit you create can have some specific code called binders that is only deployed to the browser.
The code can perform the following three functions:
- allow event handlers to attach to the mojit DOM node
- communicate with other mojits on the page
- execute actions on the mojit that the binder is attached to
For more info, visit: http://developer.yahoo.com/cocktails/mojito/docs/intro/mojito_binders.html
**/
/*jslint anon:true, sloppy:true*/
/*global YUI*/
YUI.add('read-binder-index', function(Y, NAME) {
Y.namespace('mojito.binders')[NAME] = {
init: function(mojitProxy) {
this.mp = mojitProxy;
this.spaceid = this.mp.config.spaceId;
},
/**
Setup client-side event handlers.
@param {Node} mojitNode The node for the mojit's outer div.
**/
bind: function(mojitNode) {
// Open all links in the guide in new tabs.
mojitNode.all('.content #desc a').on('click', function(evt) {
evt.preventDefault();
window.open(evt.target.get("href"), '_blank');
});
}
};
}, '0.0.1', {requires: [
'anim',
'node-event-delegate',
'scrollview',
'scrollview-paginator'
]});