Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
613 changes: 312 additions & 301 deletions api.js

Large diffs are not rendered by default.

510 changes: 258 additions & 252 deletions button/Action.js

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions button/DialogAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,66 @@
*
*/
define([
"module",
"dojo/_base/declare",
"./Action",
"./LazyDropDown",
"module",
"dojo/_base/declare",
"./Action",
"./LazyDropDown",

"dojo/_base/lang",
"dojo/_base/window",
"dojo/dom-style",
"../util/value",
"../util/async",
"dojo/_base/lang",
"dojo/_base/window",
"dojo/dom-style",
"../util/value",
"../util/async"
], function(module, declare, Action, LazyDropDown,
lang, window, style, value, async) {
lang, window, style, value, async) {

// depending on screensize, until 800px (Action) or more (LazyDropDown)
var Parent = window.global.innerWidth <= 800 ? Action : LazyDropDown;
// depending on screensize, until 800px (Action) or more (LazyDropDown)
var Parent = window.global.innerWidth <= 800 ? Action : LazyDropDown;

var mixinPrototype = Parent.prototype.isDropDown ? { // parent is ./DropDown
var mixinPrototype = Parent.prototype.isDropDown ? { // parent is ./DropDown

// LazyDropDown read as is
// LazyDropDown read as is

} : { // parent is ./Action
} : { // parent is ./Action

"class": Parent.prototype["class"] + " dropDown",
ddOptions: {},
"class": Parent.prototype["class"] + " dropDown",
ddOptions: {},

onExecute: function() {
var _this = this;
this.getWidget().then(function(widget) {
_this.appView.openPane(widget, {
closeOnClickOut: true,
dialogWidth: window.global.innerWidth - 60
});
});
},
onExecute: function() {
var _this = this;
this.getWidget().then(function(widget) {
_this.appView.openPane(widget, {
closeOnClickOut: true,
dialogWidth: window.global.innerWidth - 60
});
});
},

getWidget: function() {
return this.dialogWidget ? async.bindArg(this.dialogWidget) :
this.widgetCreateFunc().then(async.setProp(this, "dialogWidget"));
},
getWidget: function() {
return this.dialogWidget ? async.bindArg(this.dialogWidget) :
this.widgetCreateFunc().then(async.setProp(this, "dialogWidget"));
},

widgetCreateFunc: function() {
var _this = this;
return value.getModule(this.ddClass).then(function(_Class) {
// console.log("this.ddOptions", _this.ddOptions, _Class.prototype.declaredClass);
var widget = new _Class(lang.mixin({
appView: _this.appView,
anchorMode: "dialog",
closeDialogOnClickOut: true,
}, _this.ddOptions));
widget._floatAnchor = true;
style.set(widget.domNode, _this.ddStyle);
return widget;
});
},
};
widgetCreateFunc: function() {
var _this = this;
return value.getModule(this.ddClass).then(function(_Class) {
// console.log("this.ddOptions", _this.ddOptions, _Class.prototype.declaredClass);
var widget = new _Class(lang.mixin({
appView: _this.appView,
anchorMode: "dialog",
closeDialogOnClickOut: true,
}, _this.ddOptions));
widget._floatAnchor = true;
style.set(widget.domNode, _this.ddStyle);
return widget;
});
},
};

return declare(Parent, lang.mixin({
return declare(Parent, lang.mixin({

declaredClass: module.id
declaredClass: module.id

}, mixinPrototype));
}, mixinPrototype));

});
});
48 changes: 24 additions & 24 deletions button/DijitFix.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
* Mixin class to make a dijit/form/Button-based widget look like button/Action
*/
define([
"module",
"dojo/_base/declare",
"dojo/query",
"dojo/NodeList-dom",
"module",
"dojo/_base/declare",
"dojo/query",
"dojo/NodeList-dom"
], function(module, declare, query) {

return declare(null, { //--noindent--
return declare(null, { //--noindent--

fixDijitButton: true,
buttonClass: "button",
fixDijitButton: true,
buttonClass: "button",

/**
* @override
*/
buildRendering: function() {
this.inherited(arguments);
if (this.fixDijitButton) {
query(".dijitButtonNode", this.domNode)
.removeClass("dijitButtonNode")
.addClass(this.buttonClass);
}
},
/**
* @override
*/
buildRendering: function() {
this.inherited(arguments);
if (this.fixDijitButton) {
query(".dijitButtonNode", this.domNode)
.removeClass("dijitButtonNode")
.addClass(this.buttonClass);
}
},

/**
* The Class name comes from module's -- used by declare()
*/
declaredClass: module.id
/**
* The Class name comes from module's -- used by declare()
*/
declaredClass: module.id

});
});

});
});
119 changes: 59 additions & 60 deletions button/DropDown.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@
define([
"module",
"dojo/_base/declare",
"./Action",
"dijit/_HasDropDown",
"dojo/has",
"dojo/on",
"dijit/focus",

"module",
"dojo/_base/declare",
"./Action",
"dijit/_HasDropDown",
"dojo/has",
"dojo/on",
"dijit/focus"
], function(module, declare, Action, _HasDropDown, has, on, dijitFocus) {

return declare([Action, _HasDropDown], {

/**
* @override
*/
"class": Action.prototype["class"] + " dropDown",

/**
* @override
*/
noSubmit: true,

toggleOnTouchStart: false,
toggleOnTouchStop: true,

/**
* Tell others that we are a dropdown class
*/
isDropDown: true,

/**
* @override
*/
postCreate: function() {
this._buttonNode = this.focusNode = this.domNode;
this.inherited(arguments);
// var _this = this;
// if (this.toggleOnTouchStart) {
// this.own(on(this.domNode, "touchstart", function(e) {
// _this.toggleDropDown();
// }));
// }
// if (this.toggleOnTouchStop) {
// this.own(on(this.domNode, "touchstop", function(e) {
// _this.toggleDropDown();
// }));
// }
},

// Required by _HasDropDown
focus: function() {
dijitFocus.focus(this.domNode);
},

// no "onExecute" callback - managed by mouse/key events of _HasDropDown
// onExecute: function() {},

declaredClass: module.id

});

});
return declare([Action, _HasDropDown], {

/**
* @override
*/
"class": Action.prototype["class"] + " dropDown",

/**
* @override
*/
noSubmit: true,

toggleOnTouchStart: false,
toggleOnTouchStop: true,

/**
* Tell others that we are a dropdown class
*/
isDropDown: true,

/**
* @override
*/
postCreate: function() {
this._buttonNode = this.focusNode = this.domNode;
this.inherited(arguments);
// var _this = this;
// if (this.toggleOnTouchStart) {
// this.own(on(this.domNode, "touchstart", function(e) {
// _this.toggleDropDown();
// }));
// }
// if (this.toggleOnTouchStop) {
// this.own(on(this.domNode, "touchstop", function(e) {
// _this.toggleDropDown();
// }));
// }
},

// Required by _HasDropDown
focus: function() {
dijitFocus.focus(this.domNode);
},

// no "onExecute" callback - managed by mouse/key events of _HasDropDown
// onExecute: function() {},

declaredClass: module.id

});

});
Loading