Skip to content

Commit ad6fa54

Browse files
committed
Merge branch 'master' of github.com:ajaxorg/apf
2 parents b9f7c02 + c27dd3d commit ad6fa54

File tree

16 files changed

+76
-34
lines changed

16 files changed

+76
-34
lines changed

core/baseclasses/basetree.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ apf.BaseTree = function(){
726726

727727
//check databinding for how this is normally implemented
728728
this.$extend = function(xmlNode, container, immediate, callback){
729+
if (!this.$hasLoadStatus(xmlNode, "potential"))
730+
return;
731+
729732
var rule = this.$getBindRule("insert", xmlNode),
730733
xmlContext = rule && rule.match
731734
? (rule.cmatch || rule.compile("match"))(xmlNode)
@@ -786,11 +789,11 @@ apf.BaseTree = function(){
786789

787790
//this.$hasLoadStatus(e.xmlNode, "loading")
788791
if (e.action == "insert" && e.result.length > 0) {
789-
if (this.$hasLoadStatus(e.xmlNode, "loaded")) {
792+
if (this.$hasLoadStatus(e.xmlNode, "loaded", true)) {
790793
var container = this.$getLayoutNode("item", "container", htmlNode);
791794
this.slideOpen(container, e.xmlNode);//, e.$anim ? false : true
792795
}
793-
else if (this.$hasLoadStatus(e.xmlNode, "potential")) {
796+
else if (this.$hasLoadStatus(e.xmlNode, "potential", true)) {
794797
this.$setLoadStatus(e.xmlNode, "loaded");
795798
}
796799
}

core/baseclasses/databinding.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ apf.DataBinding = function(){
648648
* that is used to load data into the xmlRoot of this component.
649649
*/
650650
this.$loadSubData = function(xmlRootNode){
651-
if (this.$hasLoadStatus(xmlRootNode)) return;
651+
if (this.$hasLoadStatus(xmlRootNode) && !this.$hasLoadStatus(xmlRootNode, "potential"))
652+
return;
652653

653654
//var loadNode = this.$applyBindRule("load", xmlRootNode);
654655
var rule = this.$getBindRule("load", xmlRootNode);
@@ -769,15 +770,20 @@ apf.DataBinding = function(){
769770
/**
770771
* @private
771772
*/
773+
//@todo optimize this
772774
this.$setLoadStatus = function(xmlNode, state, remove){
773-
//remove old status if any
774-
var ostatus = xmlNode.getAttribute("a_loaded");
775-
ostatus = ostatus
776-
? ostatus.replace(new RegExp("\\|\\w+\\:" + this.$uniqueId + "\\|", "g"), "")
777-
: "";
775+
var group = this.loadgroup || "default";
776+
var re = new RegExp("\\|(\\w+)\\:" + group + ":(\\d+)\\|");
777+
var loaded = xmlNode.getAttribute("a_loaded") || "";
778778

779+
var m;
780+
if (!remove && (m = loaded.match(re)) && m[1] != "potential" && m[2] != this.$uniqueId)
781+
return;
782+
783+
//remove old status if any
784+
var ostatus = loaded.replace(re, "")
779785
if (!remove)
780-
ostatus += "|" + state + ":" + this.$uniqueId + "|";
786+
ostatus += "|" + state + ":" + group + ":" + this.$uniqueId + "|";
781787

782788
xmlNode.setAttribute("a_loaded", ostatus);
783789
};
@@ -792,11 +798,13 @@ apf.DataBinding = function(){
792798
/**
793799
* @private
794800
*/
795-
this.$hasLoadStatus = function(xmlNode, state){
801+
this.$hasLoadStatus = function(xmlNode, state, unique){
796802
var ostatus = xmlNode.getAttribute("a_loaded");
797803
if (!ostatus) return false;
798-
799-
return (ostatus.indexOf((state || "") + ":" + this.$uniqueId + "|") != -1)
804+
805+
var group = this.loadgroup || "default";
806+
var re = new RegExp("\\|" + (state || "\\w+") + ":" + group + ":" + (unique ? this.$uniqueId : "\\d+") + "\\|");
807+
return ostatus.match(re) ? true : false;
800808
};
801809

802810
/**

core/baseclasses/focussable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ apf.Focussable = function(){
6060
return this;
6161
}
6262

63-
if (this.$focus && !this.editable)
63+
if (this.$focus && !this.editable && (!e || !e.mouse || this.$focussable == apf.KEYBOARD_MOUSE))
6464
this.$focus(e);
6565

6666
this.dispatchEvent("focus", apf.extend({

core/baseclasses/guielement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ apf.GuiElement.propHandlers = {
723723
* the mouse over the element.
724724
*/
725725
"tooltip" : function(value){
726-
this.$ext.setAttribute("title", value);
726+
this.$ext.setAttribute("title", value + (this.hotkey ? " (" + this.hotkey + ")" : ""));
727727
},
728728

729729
//#ifdef __AMLCONTEXTMENU

core/debug/debugwin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ apf.$debugwin = {
11341134

11351135
activate : function(){
11361136
//Show me
1137-
this.show();
1137+
//this.show();
11381138
}
11391139
}
11401140

core/lib/queue.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ apf.queue = {
9292
apf.xmldb.notifyQueued();
9393
//#endif
9494

95-
var q = this.q;
95+
var q = this.q;
96+
this.q = {};
9697
for (var prop in q){
9798
var f = q[prop];
9899
if (f) {

core/lib/xmldb.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ apf.xmldb = new (function(){
770770
if (!this.delayUpdate && "|remove|move-away|".indexOf("|" + action + "|") > -1)
771771
this.notifyQueued(); //empty queue
772772

773-
var listen, uId, uIds, i, j, hash, info, amlNode, runTimer, found;
773+
var listen, uId, uIds, i, j, hash, info, amlNode, runTimer, found, done = {};
774774
while (loopNode && loopNode.nodeType == 1) {
775775
//Get List of Node this.$listeners ID's
776776
listen = loopNode.getAttribute(this.xmlListenTag);
@@ -780,6 +780,8 @@ apf.xmldb = new (function(){
780780

781781
for (i = 0; i < uIds.length; i++) {
782782
uId = uIds[i];
783+
if (!uId || done[uId]) continue;
784+
done[uId] = true;
783785

784786
//Property support
785787
/*if (uId.charAt(0) == "p") {

core/window.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ apf.window = function(){
536536
return;
537537
}
538538

539-
if (e.srcElement != this && this.$focus)
539+
if (e.srcElement != this && this.$focus && (!e || !e.mouse || this.$focussable == apf.KEYBOARD_MOUSE))
540540
this.$focus();
541541

542542
if (e.srcElement == this || e.trackedChild) {
@@ -968,7 +968,8 @@ apf.window = function(){
968968
else if (amlNode) { //@todo check this for documentElement apf3.0
969969
if ((p = apf.document.activeElement
970970
&& apf.document.activeElement.$focusParent || lastFocusParent)
971-
&& p.visible && p.modal && amlNode.$focusParent != p) {
971+
&& p.visible && p.modal && amlNode.$focusParent != p
972+
&& amlNode.$isWindowContainer != -1) {
972973
apf.window.$focusLast(p, {mouse: true, ctrlKey: e.ctrlKey});
973974
}
974975
else if (!amlNode && apf.document.activeElement) {

elements/bindingcolumnrule.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ apf.BindingColumnRule = function(struct, tagName){
300300
if (this.sorted)
301301
this.sort(pNode, true);
302302

303-
this.$int.onmouseover = function(e){
303+
/*this.$int.onmouseover = function(e){
304304
if (!e) e = event;
305305
306306
if (pNode.disabled) return;
307307
308308
clearTimeout(this.$timer);
309309
310310
apf.setStyleClass(this, "hover", ["down"]);
311-
};
311+
};*/
312312

313313
this.$int.onmouseup = function(e){
314314
if (!e) e = event;
@@ -493,9 +493,12 @@ apf.BindingColumnRule = function(struct, tagName){
493493
pNode.$ext.style.cursor = t && _self.$resizable
494494
? "w-resize"
495495
: "default";
496+
497+
apf.setStyleClass(this, "", ["hover", "down"]);
496498
}
497499
else {
498500
pNode.$ext.style.cursor = "default";
501+
apf.setStyleClass(this, "hover", ["down"]);
499502
}
500503
};
501504

elements/button.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ apf.button = function(struct, tagName){
6060

6161
/**** Properties and Attributes ****/
6262

63-
this.$focussable = true; // This object can get the focus
63+
this.$focussable = apf.KEYBOARD; // This object can get the focus
6464
this.value = null;
6565

6666
this.$init(function(){
@@ -292,6 +292,9 @@ apf.button = function(struct, tagName){
292292
_self.dispatchEvent("click");
293293
});
294294
}
295+
296+
if (this.tooltip)
297+
apf.GuiElement.propHandlers.tooltip.call(this, this.tooltip);
295298
}
296299
//#endif
297300

@@ -531,6 +534,11 @@ apf.button = function(struct, tagName){
531534

532535
/**** Init ****/
533536

537+
this.addEventListener("$skinchange", function(e){
538+
if (this.tooltip)
539+
apf.GuiElement.propHandlers.tooltip.call(this, this.tooltip);
540+
});
541+
534542
this.$draw = function(){
535543
var pNode, isToolbarButton = (pNode = this.parentNode)
536544
&& pNode.parentNode.localName == "toolbar";

0 commit comments

Comments
 (0)