diff --git a/demo/index.html b/demo/index.html index 3ed89b7..0df4a19 100644 --- a/demo/index.html +++ b/demo/index.html @@ -13,13 +13,13 @@
<button>
<a target="modal" href="https://server.cocreate.app/CoCreate-adminUI/module_datatable.html"
- data-modal_ajax="false"
- data-modal_width="520px"
- data-modal_height="100%"
- data-modal_color="#229954"
- data-modal_header="false"
- data-modal_x="0px"
- data-modal_y="0px"
+ modal-ajax="false"
+ modal-width="520px"
+ modal-height="100%"
+ modal-color="#229954"
+ modal-header="false"
+ modal-x="0px"
+ modal-y="0px"
data-open_in="page">
Show Modal On Page
</a>
@@ -95,31 +95,31 @@ href string Href attribute indicates html file to set in modal.
- data-modal_ajax boolean optional
+ modal-ajax boolean optional
Attribute whether to use ajax or not.
- data-modal_width string optional
+ modal-width string optional
Width of modal. Unit can be pixel or percent.
- data-modal_height string optional
+ modal-height string optional
Height of modal. Unit can be pixel or percent.
- data-modal_color color optional
+ modal-color color optional
Color of modal border.
- data-modal_header boolean optional
+ modal-header boolean optional
Attribute whether to show header or not.
- data-modal_x string optional
+ modal-x string optional
Position X of modal.
- data-modal_y string optional
+ modal-y string optional
Position Y of modal.
@@ -143,8 +143,8 @@ Demo
-
+
diff --git a/src/index.js b/src/index.js
index 43d7424..b05848e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -163,18 +163,18 @@ CoCreateWindow.prototype = {
var attr = {
url: aTag.href,
- x: aTag.getAttribute('data-modal_x'),
- y: aTag.getAttribute('data-modal_y'),
- width: aTag.getAttribute('data-modal_width'),
- height: aTag.getAttribute('data-modal_height'),
- ajax: aTag.getAttribute('data-modal_ajax'),
- color: aTag.getAttribute('data-modal_color'),
- header: aTag.getAttribute('data-modal_header'),
+ x: aTag.getAttribute('modal-x'),
+ y: aTag.getAttribute('modal-y'),
+ width: aTag.getAttribute('modal-width'),
+ height: aTag.getAttribute('modal-height'),
+ ajax: aTag.getAttribute('modal-ajax'),
+ color: aTag.getAttribute('modal-color'),
+ header: aTag.getAttribute('modal-header'),
attributes: utils.getAttributes(aTag)
}
- var open_type = aTag.getAttribute('data-modal_open');
+ var open_type = aTag.getAttribute('modal-open');
open_type = open_type ? open_type : 'root';
ModalStorage.rootPageId = this.rootId;
diff --git a/src/modal.js b/src/modal.js
index 6874dd6..48386e4 100644
--- a/src/modal.js
+++ b/src/modal.js
@@ -75,14 +75,14 @@ Modal.prototype = {
_init : function() {
var opt = this.options;
- this.isAjax = opt.ajax ? opt.ajax : this.el.getAttribute("data-modal_ajax")
+ this.isAjax = opt.ajax ? opt.ajax : this.el.getAttribute("modal-ajax")
var windowURL = opt.url ? opt.url : this.el.getAttribute("href");
- var width = opt.width ? opt.width : this.el.getAttribute("data-modal_width");
- var height = opt.height? opt.height : this.el.getAttribute("data-modal_height");
- var color = opt.color ? opt.color : this.el.getAttribute("data-modal_color");
- var x = opt.x ? opt.x : this.el.getAttribute("data-modal_x")
- var y = opt.y ? opt.y : this.el.getAttribute("data-modal_y")
- var showHeader= opt.header? opt.header : this.el.getAttribute("data-modal_header")
+ var width = opt.width ? opt.width : this.el.getAttribute("modal-width");
+ var height = opt.height? opt.height : this.el.getAttribute("modal-height");
+ var color = opt.color ? opt.color : this.el.getAttribute("modal-color");
+ var x = opt.x ? opt.x : this.el.getAttribute("modal-x")
+ var y = opt.y ? opt.y : this.el.getAttribute("modal-y")
+ var showHeader= opt.header? opt.header : this.el.getAttribute("modal-header")
var attributes = opt.attributes;
@@ -143,15 +143,15 @@ Modal.prototype = {
iframe = this.__createContainer(this.headerArea);
iframe.src = windowURL;
} else if (attributes) {
- iframe = this.__createContainer(this.headerArea, attributes['data-modal_iframe'] === "false" ? "div" : "iframe");
- if (attributes['data-pass_to']) {
- iframe.setAttribute('data-pass_id', attributes['data-pass_to']);
+ iframe = this.__createContainer(this.headerArea, attributes['modal-iframe'] === "false" ? "div" : "iframe");
+ if (attributes['pass_to']) {
+ iframe.setAttribute('pass_id', attributes['pass_to']);
iframe.setAttribute('collection', "");
iframe.setAttribute('document_id', "");
// iframe.setAttribute('data-request_id', uuid.generate());
}
- if (attributes['data-pass_name']) {
- iframe.setAttribute('name', attributes['data-pass_name']);
+ if (attributes['pass-name']) {
+ iframe.setAttribute('name', attributes['pass-name']);
}
} else {
return;