Skip to content

Commit

Permalink
Merge pull request #74 from canjs/four-oh
Browse files Browse the repository at this point in the history
Upgrade to be compatible with canjs 4.0
  • Loading branch information
matthewp committed Dec 12, 2017
2 parents 6d83ca0 + 7fdbd11 commit c330208
Show file tree
Hide file tree
Showing 3 changed files with 7,395 additions and 20 deletions.
20 changes: 10 additions & 10 deletions can-view-autorender.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var canViewModel = require('can-view-model');
var camelize = require('can-util/js/string/string').camelize;
var each = require('can-util/js/each/each');
var importer = require('can-util/js/import/import');
var events = require('can-event');
var namespace = require('can-util/namespace');
var canViewModel = require("can-view-model");
var camelize = require("can-util/js/string/string").camelize;
var each = require("can-util/js/each/each");
var importer = require("can-util/js/import/import");
var namespace = require("can-namespace");
var domEvents = require("can-util/dom/events/events");

var ignoreAttributesRegExp = /^(dataViewId|class|id|type|src)$/i;

Expand Down Expand Up @@ -39,7 +39,7 @@ function insertAfter(ref, element) {

function render(renderer, scope, el) {
var frag = renderer(scope);
if( isIn(el,"head") ) {
if( isIn(el, "head") ) {
document.body.appendChild(frag);
} else if(el.nodeName.toLowerCase() === "script") {
insertAfter(el, frag);
Expand All @@ -55,7 +55,7 @@ function setupScope(el) {
setAttr(el, attr.name, scope);
});

events.on.call(el, "attributes", function (ev) {
domEvents.addEventListener.call(el, "attributes", function(ev) {
setAttr(el, ev.attributeName, scope);
});

Expand Down Expand Up @@ -91,10 +91,10 @@ var promise = new Promise(function(resolve, reject) {
Promise.all(promises).then(resolve, reject);
}

if (document.readyState === 'complete') {
if (document.readyState === "complete") {
autoload();
} else {
events.on.call(window, 'load', autoload);
domEvents.addEventListener.call(window, "load", autoload);
}
});

Expand Down
Loading

0 comments on commit c330208

Please sign in to comment.