-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjs_lib_core_cbobject_cbobject.js.html
More file actions
91 lines (69 loc) · 3.89 KB
/
js_lib_core_cbobject_cbobject.js.html
File metadata and controls
91 lines (69 loc) · 3.89 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: js/lib/core/cbobject/cbobject.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: js/lib/core/cbobject/cbobject.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Base object to components. This object include position, size, type and others common elemens
* @param {Object} objectdata Object base definition
* @param {Array} objectdata.position Object position on page
* @param {Array} objectdata.size Object size
* @param {String} objectdata.type Object type . This is used to restore object when load project
* @class CBObject
*/
function CBObject(objectdata){
this.position = typeof objectdata.position !== 'undefined' ? objectdata.position : [200,200];
this.size = typeof objectdata.size !== 'undefined' ? objectdata.size : [0,0];
this.idtype = typeof objectdata.idtype !== 'undefined' ? objectdata.idtype : "CBObject";
}
/**
* Render object to jQuery object to be included on page
* @return {jQuery}
*/
CBObject.prototype.editorView = function editorView() {
var aux = $(window.document.createElement('div'));
aux.css('left', this.position[0])
.css('top', this.position[1])
.addClass('draggable')
.addClass('cbobject')
.addClass('cbobject-editable')
.css('position','relative');
return aux;
};
/**
* This string is return core to bind on button click event on editor view
* @param {jQuery} jquerycbo jQuery representation object that is included on targetcontent
* @param {CBOjbect} objectcbo CBObject that is stored on the project to later load project or export to other format.
* @return {String} Function string.
*/
CBObject.prototype.add_callback = function add_callback(jquerycbo,objectcbo) {
jquerycbo.draggable( {stop: function(event,ui){ objectcbo.position = [ui.position.left,ui.position.top]; }, scroll:true});
};
module.exports = CBObject;</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Backend.html">Backend</a></li><li><a href="CBObject.html">CBObject</a></li><li><a href="CBSection.html">CBSection</a></li><li><a href="ConfigUserManager.html">ConfigUserManager</a></li><li><a href="Controller.html">Controller</a></li><li><a href="StorageManager.html">StorageManager</a></li><li><a href="TextBox.html">TextBox</a></li><li><a href="Translator.html">Translator</a></li><li><a href="UI.html">UI</a></li><li><a href="Util.html">Util</a></li></ul><h3>Namespaces</h3><ul><li><a href="application.html">application</a></li><li><a href="application.backend.html">backend</a></li><li><a href="application.controller.html">controller</a></li><li><a href="application.storagemanager.html">storagemanager</a></li><li><a href="application.ui.html">ui</a></li><li><a href="Cloudbook.html">Cloudbook</a></li><li><a href="Cloudbook.Actions.html">Actions</a></li><li><a href="Cloudbook.Sections.html">Sections</a></li><li><a href="Cloudbook.UI.html">UI</a></li><li><a href="Project.html">Project</a></li><li><a href="Project.Data.html">Data</a></li><li><a href="Project.Info.html">Info</a></li></ul><h3>Global</h3><ul><li><a href="global.html#getInstance">getInstance</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-beta3</a> on Tue Mar 24 2015 12:37:37 GMT+0100 (CET)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>