1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Merge pull request #3706 from imcotton/script-data-src

Optionally to read data-src out from <script>
This commit is contained in:
Jeremy Ashkenas 2015-03-09 09:41:32 -04:00
commit 0a3e3639dc
2 changed files with 7 additions and 5 deletions

View file

@ -104,12 +104,13 @@
}
};
fn = function(script, i) {
var options;
var options, source;
options = {
literate: script.type === coffeetypes[1]
};
if (script.src) {
return CoffeeScript.load(script.src, function(param) {
source = script.src || script.getAttribute('data-src');
if (source) {
return CoffeeScript.load(source, function(param) {
coffees[i] = param;
return execute();
}, options, true);

View file

@ -69,8 +69,9 @@ runScripts = ->
for script, i in coffees
do (script, i) ->
options = literate: script.type is coffeetypes[1]
if script.src
CoffeeScript.load script.src,
source = script.src or script.getAttribute('data-src')
if source
CoffeeScript.load source,
(param) ->
coffees[i] = param
execute()