Skip to content
Browse files

Some updating of dojo calls.

Fix starting splash overlay animation.
Now mouse events are working:  but still lots
of mouse click - related bugs.
  • Loading branch information...
1 parent 7197bc8 commit a3584af88de0245822c1edcaadebe62c260ef7d1 @bvds committed Jan 1, 2014
Showing with 28 additions and 20 deletions.
  1. +9 −7 web-UI/andes/Combo.js
  2. +7 −4 web-UI/andes/WordTip.js
  3. +3 −2 web-UI/andes/api.js
  4. +1 −1 web-UI/andes/menu.js
  5. +8 −6 web-UI/andes/startup.js
View
16 web-UI/andes/Combo.js
@@ -1,8 +1,9 @@
define([
"dojox/drawing/util/oo",
"dojo/on",
- "dojo/_base/array"
-],function(oo,on,array){
+ "dojo/_base/array",
+ "dojo/_base/lang"
+],function(oo,on,array,lang){
window.andes.Combo = oo.declare(
// summary:
@@ -21,7 +22,7 @@ window.andes.Combo = oo.declare(
this.master.combo = this.statement.combo = this;
this._props = {style:this.master.style, util:this.master.util, parent:this.master.parent, mouse:this.master.mouse};
- dojo.mixin(this, this._props);
+ lang.mixin(this, this._props);
this.id = options.id || this.util.uid(this.type);
this.linked = [];
this._cons = [];
@@ -186,7 +187,7 @@ window.andes.Combo = oo.declare(
}else if (once){
// ** object function object function Boolean **
c = on(o, e, function(evt){
- dojo.hitch(s, m)(evt);
+ lang.hitch(s, m)(evt);
c.remove();
});
this._cons.push(c);
@@ -201,8 +202,9 @@ window.andes.Combo = oo.declare(
disconnect: function(handles){
if(!handles) { return; }
- if(!dojo.isArray(handles)){ handles=[handles]; }
- array.forEach(handles, function(handle){handle.remove();},dojo);
+ if(!(handles instanceof Array)){ handles=[handles]; }
+ // pre-AMD version had dojo as environment
+ array.forEach(handles, function(handle){handle.remove();});
}
}
);
@@ -232,7 +234,7 @@ window.andes.buttonCombo = oo.declare(
attr: function(a1, a2){
// see Drawing.stencil._Base
- dojo.forEach(this.items,function(item){
+ array.forEach(this.items,function(item){
item.master.attr.call(item.master, a1, a2);
if(item.statement){ // associated text is optional
item.statement.attr.call(item.statement, a1, a2);
View
11 web-UI/andes/WordTip.js
@@ -2,9 +2,11 @@ define([
'dojo/_base/declare',
'dojo/on',
"dojo/dom",
+ "dojo/keys",
+ "dojo/_base/lang",
"dojo/domReady!" // Needed to locate "conEdit"
// pre-AMD version had no requires
-], function(declare,on,dom){
+], function(declare,on,dom,keys,lang){
return declare(null,{
// Summary:
@@ -35,18 +37,19 @@ define([
},
textMonitor: function(evt){
- if(evt.keyCode == dojo.keys.SPACE || evt.keyCode == dojo.keys.TAB || evt.keyCode == 188){
+ if(evt.keyCode == keys.SPACE || evt.keyCode == keys.TAB || evt.keyCode == 188){
console.log("andes.WordTip.textMonitor this=",this);
- var tx = dojo.trim(this.conEdit.innerHTML);//this.statement.cleanText(conEdit.innerHTML);
+ var tx = lang.trim(this.conEdit.innerHTML);//this.statement.cleanText(conEdit.innerHTML);
tx = this.removeBreaks(tx);
var symbol = window.andes.variablename.parse(tx);
console.log("---Text for word-suggest----> ", tx,symbol);
this.sendToServer(tx,symbol);
};
- if(evt.keyCode == dojo.keys.ENTER || evt.keyCode == dojo.keys.ESCAPE){
+ if(evt.keyCode == keys.ENTER || evt.keyCode == keys.ESCAPE){
dijit.hideTooltip(this.conEdit);
}
var cn = on(document,"mouseup",this, function(evt){
+ console.log("WordTip.js: responding to mouseup event");
cn.remove();
dijit.hideTooltip(this.conEdit);
});
View
5 web-UI/andes/api.js
@@ -1,10 +1,11 @@
define([
+ "dojo/_base/lang",
// pre-AMD version requires:
"andes/timer",
"andes/rpc",
"andes/error",
"andes/messages"
-],function(timer){ // Pre-AMD version had a function wrapper.
+],function(lang,timer){ // Pre-AMD version had a function wrapper.
var startTime = null,
requestInFlight = false,
@@ -29,7 +30,7 @@ define([
function prepRequest(req){
// add common elements to our requests
var tm = ((new Date()).getTime() - (startTime || (new Date()).getTime()))/1000.0;
- return dojo.mixin({ time:tm }, req || {});
+ return lang.mixin({ time:tm }, req || {});
}
function sendRequest(req){
View
2 web-UI/andes/menu.js
@@ -118,7 +118,7 @@ define([
var node = null;
aspect.after(window._drawing.mouse, "onDown", function(evt){
- // console.log("On down evt: ", evt);
+ console.log("menu.js: mouse onDown event ", evt);
// Dynamically prepare menu depending on the target
// if it's a stencil, allow delete
window.andes.contextMenu.unBindDomNode(node);
View
14 web-UI/andes/startup.js
@@ -141,12 +141,14 @@ define([
});
// Splash animation
- var splashNode = dom.byId("splashOverlay"),
- anim = fx.fadeOut({node:splashNode}).play();
- var _h = on(anim, "onEnd", function(){
- _h.remove();
- domStyle.set(splashNode, "display", "none");
- console.log("andes.main loaded");
+ var splashNode = dom.byId("splashOverlay");
+ console.assert(splashNode,"splashOverlay element missing in html");
+ var anim = fx.fadeOut({
+ node:splashNode,
+ onEnd: function(node){
+ domStyle.set(node, "display", "none");
+ console.log("andes.main loaded, splash removed");
+ }
});
anim.play();
});

0 comments on commit a3584af

Please sign in to comment.
Something went wrong with that request. Please try again.