projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove redundant logging.
[mkws-moved-to-github.git]
/
src
/
mkws-popup.js
diff --git
a/src/mkws-popup.js
b/src/mkws-popup.js
index
275d541
..
48e375a
100644
(file)
--- a/
src/mkws-popup.js
+++ b/
src/mkws-popup.js
@@
-2,30
+2,32
@@
*
*/
*
*/
-// "use strict";
-$(document).ready(function () {
- // mkws.registerWidgetType('PopupWindow', function() {
+//"use strict";
+// $(document).ready(function () {
+mkws.registerWidgetType('popup', function() {
var $ = mkws.$;
var $ = mkws.$;
- var debug = mkws.log;
+ var debug = this.log;
debug("init popup window");
debug("init popup window");
- if (!$.ui) {
- alert("Error: jquery-ui.js is missing, did you include it after jQuery core in the HTML file?");
+ var popup_window = $(this.node);
+ // var popup_window = $(".mkwsPopup"); // $(document).ready()
+ if (!popup_window) {
+ debug("no popup found, skip...");
return;
return;
+ } else {
+ debug("number of popup windows found: " + popup_window.length);
}
}
- var popup_window = $(".PopupWindow");
- if (!popup_window) {
- debug("no popup found, skip");
+ if (!$.ui) {
+ alert("Error: jquery-ui.js is missing, did you include it after jQuery core in the HTML file?");
return;
return;
- } else {
- debug("found popup windows: " + popup_window.length);
}
// more than one widget on a page are possible
}
// more than one widget on a page are possible
- popup_window.each(function (i) {
+ popup_window.each(function(i) {
var that = $(this);
var that = $(this);
+ // all atributes are strings, convert them to integers here
var width = parseInt(that.attr("popup_width") || "800");
var height = parseInt(that.attr("popup_height") || "600");
var autoOpen = parseInt(that.attr("popup_autoOpen") || "0");
var width = parseInt(that.attr("popup_width") || "800");
var height = parseInt(that.attr("popup_height") || "600");
var autoOpen = parseInt(that.attr("popup_autoOpen") || "0");
@@
-40,17
+42,17
@@
$(document).ready(function () {
modal: modal ? true : false,
resizable: true,
buttons: {
modal: modal ? true : false,
resizable: true,
buttons: {
- Cancel: function () {
+ Cancel: function() {
that.dialog("close");
}
},
that.dialog("close");
}
},
- close: function () {}
+ close: function() {}
});
});
- // open at search query submit
+ // open at search query submit: "input.mkwsButton"
var id_botton = that.attr("popup_button");
if (id_botton) {
var id_botton = that.attr("popup_button");
if (id_botton) {
- $(id_botton).button().click(function () {
+ $(id_botton).button().click(function() {
that.dialog("open");
});
}
that.dialog("open");
});
}