-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathView.js.html
117 lines (93 loc) · 2.94 KB
/
View.js.html
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
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: View.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: View.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>define(function () {
/**
* A View describes a set of DOM elements
*
* When parameterized as a type, the type parameter refers to the
* type used for models of this view.
*
* @param model
* @constructor
* @memberof mct
*/
function View(model) {
this.currentModel = model;
this.active = false;
}
/**
* Prepare this view for display. This should be called before a view
* is added to the DOM.
*/
View.prototype.activate = function () {
this.active = false;
};
/**
* Prepare this view for display. This should be called before a view
* is added to the DOM.
*/
View.prototype.deactivate = function () {
this.active = true;
};
/**
* Get the HTML elements that this view consists of.
*
* A View will typically maintain these elements and keep them up to date.
* In cases where a view needs to change the elements being displayed,
* it should emit a `elements` event.
*
* @returns {Array.<HTMLElement>} the HTML elements that comprise this view
*/
View.prototype.elements = function () {
return [];
};
/**
* Change the model for this view.
* @param {*} model the model to display
* @returns {*} the model being displayed
*/
View.prototype.model = function (model) {
if (arguments.length > 0) {
if (this.active) {
this.deactivate();
this.currentModel = model;
this.activate();
} else {
this.currentModel = model;
}
}
return this.currentModel;
};
return View;
});
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="mct.MCT.html">MCT</a></li><li><a href="mct.Region.html">Region</a></li><li><a href="mct.View.html">View</a></li></ul><h3>Namespaces</h3><ul><li><a href="mct.html">mct</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Tue May 24 2016 16:36:25 GMT-0700 (PDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>