Skip to content

Instantly share code, notes, and snippets.

View edchat's full-sized avatar

Ed Chatelain edchat

View GitHub Profile
@edchat
edchat / LogAllAppEvents.js
Created August 9, 2013 20:09
LogAllAppEvents, a custom controller created to log all dojox/app events to see when these events are fired.
define(["dojo/_base/lang", "dojo/_base/declare", "dojox/app/Controller"],
function(lang, declare, Controller){
// module:
// dojox/app/tests/mediaQuery3ColumnApp/controllers/LogAllAppEvents
// summary:
// This Custom controller created to log all dojox/app events to see when these events are fired.
return declare("dojox/app/tests/mediaQuery3ColumnApp/controllers/LogAllAppEvents", Controller, {
constructor: function(){
@edchat
edchat / CustomLoaderDefaults.js
Created October 18, 2013 16:15
Custom dojox/app loader to always load the default child views for a view the first time the view is loaded. The name of the custom loader is CustomLoaderDefaults.js
define(["require", "dojo/_base/lang", "dojo/_base/declare", "dojo/on", "dojo/Deferred", "dojo/when", "dojo/dom-style", "dojox/app/controllers/Load"],
function(require, lang, declare, on, Deferred, when, domStyle, Controller, View){
// module:
// dojox/app/tests/nestedTestApp/controllers/CustomLoaderDefaults
// summary:
// A custom logger to handle always loading the defaultViews when a view is loaded for the first time.
// Bind "app-load" event on dojox/app application instance.
// Load child view and sub children at one time.
//
//
@edchat
edchat / LICENSE
Last active December 26, 2015 19:29
dojox/app workaround for the iOS7 Status Bar problem. See the summary in controllers/ios7StatusBarLayout.js for detials.
This gist and Dojo is available under *either* the terms of the modified BSD license *or* the
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
license to receive this code under (except as noted in per-module LICENSE
files). Some modules may not be the copyright of the Dojo Foundation. These
modules contain explicit declarations of copyright in both the LICENSE files in
the directories in which they reside and in the code itself. No external
contributions are allowed under licenses which are fundamentally incompatible
with the AFL or BSD licenses that Dojo is distributed under.
The text of the AFL and BSD licenses is reproduced below.
@edchat
edchat / addToMain.js
Last active December 28, 2015 22:08
Function to get the Parent View from a View Target
getParentFromViewTarget: function (viewTarget) {
// summary:
// A convenience function to get the Parent View for a View Target
//
// viewTarget:
// The view target, like "ParentView1,SubViewA,ChildViewX"
//
// Calls would look like this:
//
// var parentViewOfChildViewX = this.app.getParentFromViewTarget("ParentView1,SubViewA,ChildViewX");
@edchat
edchat / gist:18c9b25eef34f2be217b
Created June 19, 2014 15:30
dojox/app getViewFromViewId Function
getViewFromViewId: function (app, viewId) {
if (viewId) {
var parts = viewId.split("_");
parts.shift(); // remove app from parts
var view = app;
var nextChildId = app.id + "_";
for (var item in parts) {
var childId = nextChildId + parts[item];
view = view.children[childId];
nextChildId = childId + "_";