golf 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/golf/version.rb +1 -1
- data/resources/jquery.golf.js +16 -2
- metadata +2 -2
data/lib/golf/version.rb
CHANGED
data/resources/jquery.golf.js
CHANGED
@@ -395,6 +395,7 @@ function componentConstructor(name) {
|
|
395
395
|
|
396
396
|
if (cmp) {
|
397
397
|
obj._dom = cmp.dom.clone();
|
398
|
+
obj._dom.data("_golf_component", obj);
|
398
399
|
obj._dom.data("_golf_constructing", true);
|
399
400
|
obj.require = $fake.require;
|
400
401
|
checkForReservedClass(obj._dom.children().find("*"));
|
@@ -591,6 +592,11 @@ if (serverside) {
|
|
591
592
|
$(this).removeData("_golf_prepared");
|
592
593
|
});
|
593
594
|
jss.mark(this);
|
595
|
+
$("*", e).each(function(index, elem) {
|
596
|
+
var cmp = $(elem).data("_golf_component");
|
597
|
+
if (cmp instanceof Component && cmp.onAppend)
|
598
|
+
cmp.onAppend();
|
599
|
+
});
|
594
600
|
if (a instanceof Component && a.onAppend)
|
595
601
|
a.onAppend();
|
596
602
|
return $(this);
|
@@ -600,11 +606,19 @@ if (serverside) {
|
|
600
606
|
|
601
607
|
$.fn._golf_remove = $.fn.remove;
|
602
608
|
$.fn.remove = function() {
|
603
|
-
|
609
|
+
var cmps = [];
|
610
|
+
$("*", this).add([this]).each(function(index, elem) {
|
611
|
+
var cmp = $(elem).data("_golf_component");
|
612
|
+
if (cmp)
|
613
|
+
cmps.push({component: cmp, dom: elem});
|
604
614
|
if ($(this).attr("golfid"))
|
605
615
|
$.golf.events[$(this).attr("golfid")] = [];
|
606
616
|
});
|
607
|
-
|
617
|
+
var ret = $.fn._golf_remove.call(this);
|
618
|
+
$.each(cmps, function(index, item) {
|
619
|
+
$(item.dom).data("_golf_component", item.component);
|
620
|
+
});
|
621
|
+
return ret;
|
608
622
|
};
|
609
623
|
|
610
624
|
$.each(
|