Skip to content

Commit

Permalink
Merge pull request #341 from canjs/domdata
Browse files Browse the repository at this point in the history
Replace can-dom-data-state with can-dom-data
  • Loading branch information
matthewp authored May 6, 2019
2 parents 070e537 + 2d99862 commit 67e6e67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions can-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var canDev = require('can-log/dev/dev');
var assign = require('can-assign');
var ObservationRecorder = require("can-observation-recorder");
var queues = require("can-queues");
var domData = require('can-dom-data-state');
var domData = require('can-dom-data');
var getChildNodes = require('can-child-nodes');
var string = require("can-string");
var domEvents = require('can-dom-events');
Expand Down Expand Up @@ -78,7 +78,7 @@ function addContext(el, tagData, insertionElementTagData) {
newScope;

// Prevent setting up bindings manually.
domData.set.call(el, "preventDataBindings", true);
domData.set(el, "preventDataBindings", true);

var teardown = stacheBindings.behaviors.viewModel(el, insertionElementTagData,
// `createViewModel` is used to create the ViewModel that the
Expand Down Expand Up @@ -470,7 +470,7 @@ var Component = Construct.extend(
var viewModel;
var initialViewModelData = {};

var preventDataBindings = domData.get.call(el, "preventDataBindings");
var preventDataBindings = domData.get(el, "preventDataBindings");

var teardownBindings;
if (preventDataBindings) {
Expand Down Expand Up @@ -520,7 +520,7 @@ var Component = Construct.extend(
this.viewModel = viewModel;
el[viewModelSymbol] = viewModel;
el.viewModel = viewModel;
domData.set.call(el, "preventDataBindings", true);
domData.set(el, "preventDataBindings", true);

// an array of teardown stuff that should happen when the element is removed
var teardownFunctions = [];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"can-construct": "^3.2.0",
"can-control": "^4.0.0",
"can-define": "^2.0.0",
"can-dom-data-state": "^1.0.1",
"can-dom-data": "^1.0.1",
"can-dom-events": "^1.1.0",
"can-dom-mutate": "^1.0.0",
"can-fragment": "^1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions test/component-viewmodel-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var QUnit = require("steal-qunit");

var canData = require('can-dom-data-state');
var canData = require('can-dom-data');
var helpers = require("./helpers");
var SimpleMap = require("can-simple-map");
var stache = require("can-stache");
Expand Down Expand Up @@ -555,11 +555,11 @@ helpers.makeTests("can-component viewModels", function(){

var vm = new DefineMap({ value: "it worked" });
el[canSymbol.for('can.viewModel')] = vm;
canData.set.call(el, "preventDataBindings", true);
canData.set(el, "preventDataBindings", true);
callback(el, {
scope: new Scope({ value: "it did not work" })
});
canData.set.call(el, "preventDataBindings", false);
canData.set(el, "preventDataBindings", false);

QUnit.equal(el.firstChild.nodeValue, "it worked");
});
Expand Down

0 comments on commit 67e6e67

Please sign in to comment.