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:
commit
0a3e3639dc
2 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue