-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul of cards approach to take advantage of position fixed suppor…
…t in ios5 and android, but still having trouble with scroll position in chats. Android not scrolling even though test page does. Also fixes issue with intermittent errors with using the google API by using async plugin.
- Loading branch information
Showing
7 changed files
with
279 additions
and
241 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** @license | ||
* RequireJS plugin for async dependency load like JSONP and Google Maps | ||
* Author: Miller Medeiros | ||
* Version: 0.1.0 (2011/03/23) | ||
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> | ||
*/ | ||
define(function(){ | ||
|
||
function injectScript(src){ | ||
var s, t; | ||
s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src; | ||
t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t); | ||
} | ||
|
||
function formatUrl(name, id){ | ||
var paramRegex = /!(.+)/, | ||
url = name.replace(paramRegex, ''), | ||
param = (paramRegex.test(name))? name.replace(/.+!/, '') : 'callback'; //default param name is 'callback' | ||
url += (url.indexOf('?') < 0)? '?' : '&'; | ||
return url + param +'='+ id; | ||
} | ||
|
||
return{ | ||
load : function(name, req, onLoad, config){ | ||
if(config.isBuild){ | ||
onLoad(null); //avoid errors on the optimizer | ||
}else{ | ||
var id = '__mm_asynch_req__'+ (+new Date()); | ||
window[id] = onLoad; //create a global variable that stores onLoad so callback function can define new module after async load | ||
injectScript(formatUrl(name, id)); | ||
} | ||
} | ||
}; | ||
}); |
Oops, something went wrong.