Skip to content

Commit

Permalink
upgraded to ember 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritesh Keswani committed Nov 11, 2015
1 parent 81cf783 commit 7521d2b
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 79 deletions.
3 changes: 1 addition & 2 deletions .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,
"live-reload-port": 35730
"disableAnalytics": false
}
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bower_components/
tests/
tmp/
dist/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
ember-cli-build.js
Brocfile.js
testem.json
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp"]
}
22 changes: 0 additions & 22 deletions Brocfile.js

This file was deleted.

13 changes: 9 additions & 4 deletions addon/components/ember-jstree.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default Ember.Component.extend(InboundActions, EmberJstreeActions, {
_isDestroying: false,

isReady: false,

_isReadyTestWaiter: function() {
return this.get('isReady') === true;
},
Expand Down Expand Up @@ -159,7 +160,7 @@ export default Ember.Component.extend(InboundActions, EmberJstreeActions, {
var node = self.get('currentNode');
self.send("contextmenuItemDidClick", action, node);
});
}
};
})(this, emberAction);
}
}
Expand Down Expand Up @@ -303,11 +304,15 @@ export default Ember.Component.extend(InboundActions, EmberJstreeActions, {
* @method _redrawTree
*/
_refreshTree: Ember.observer('data', function() {
var o = this.get('treeObject');
var t = o.jstree(true);
if (null !== t) {
var t = this.getTree();
if (null !== t && false !== t) {
t.settings.core['data'] = this.get('data');
t.refresh();
} else {
// setup again if destroyed
var treeObject = this._setupJsTree();
this._setupEventHandlers(treeObject);
this.set('treeObject', treeObject);
}
}),

Expand Down
5 changes: 3 additions & 2 deletions addon/mixins/ember-jstree-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ export default Ember.Mixin.create({
selectNodes: function(property, values) {
var treeObject = this.get('treeObject');
if (null !== treeObject) {
var i;
if ('id' === property) {
// If property is ID, can use get_node, which is faster than search.
if(Ember.$.isArray(values)) {
var nodes = [];
for(var i=0; i<values.length; i++) {
for(i=0; i<values.length; i++) {
var node = treeObject.jstree(true).get_node(values[i]);
nodes.push(node);
}
Expand All @@ -226,7 +227,7 @@ export default Ember.Mixin.create({
}.bind(this));

if(Ember.$.isArray(values)) {
for(var i=0; i<values.length; i++) {
for(i=0; i<values.length; i++) {
treeObject.jstree(true).search(values[i]);
}

Expand Down
21 changes: 11 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "ember-cli-jstree",
"dependencies": {
"ember": "1.12.0",
"ember": "2.1.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.0.0-beta.17",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
"ember-qunit": "0.3.3",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
"qunit": "~1.17.1",
"jstree": "git://github.com/cristinawithout/jstree.git#4cbfbe263949fa1c88e45faa1c8233348ce25352",
"ember-resolver": "~0.1.15",
"jquery": "^1.11.1",
"loader.js": "ember-cli/loader.js#3.2.0",
"qunit": "~1.17.1"
"ember-resolver": "~0.1.18",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.2.1",
"qunit": "~1.18.0",
"jstree": "git://github.com/cristinawithout/jstree.git#4cbfbe263949fa1c88e45faa1c8233348ce25352"
},
"resolutions": {
"ember": "2.1.0"
}
}
17 changes: 17 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
});

/*
This build file specifes the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
};
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"start": "ember server",
"test": "ember try:testall"
},
"repository": {
Expand All @@ -21,21 +21,23 @@
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.2",
"ember-cli": "1.13.1",
"ember-cli-app-version": "0.3.3",
"broccoli-asset-rev": "^2.1.2",
"ember-cli": "1.13.8",
"ember-cli-app-version": "0.5.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.0.0",
"ember-cli-htmlbars": "0.7.6",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"testem": "^0.8.0",
"ember-cli-qunit": "0.3.13",
"ember-cli-uglify": "^1.0.1",
"ember-data": "1.0.0-beta.17",
"ember-disable-proxy-controllers": "^0.7.0",
"ember-export-application-global": "^1.0.2",
"ember-try": "0.0.4"
"ember-cli-dependency-checker": "^1.0.1",
"ember-cli-htmlbars": "0.7.9",
"ember-cli-htmlbars-inline-precompile": "^0.2.0",
"ember-cli-ic-ajax": "0.2.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.0",
"ember-cli-release": "0.2.3",
"ember-cli-sri": "^1.0.3",
"ember-cli-uglify": "^1.2.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-try": "0.0.6"
},
"keywords": [
"ember-addon",
Expand All @@ -51,4 +53,4 @@
"ember-addon": {
"configPath": "tests/dummy/config"
}
}
}
5 changes: 3 additions & 2 deletions tests/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"node": false,
"browser": false,
"boss": true,
"curly": false,
"curly": true,
"debug": false,
"devel": false,
"eqeqeq": true,
Expand All @@ -47,5 +47,6 @@
"strict": false,
"white": false,
"eqnull": true,
"esnext": true
"esnext": true,
"unused": true
}
1 change: 1 addition & 0 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
});

Expand Down
7 changes: 3 additions & 4 deletions tests/dummy/app/dynamic/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ export default Ember.Controller.extend({
this.get('jstreeActionReceiver').send('destroy');
},

handleTreeSelectionDidChange: function(data) {
var selected = this.get('jsTreeActionReceiver').send('getSelected');
handleTreeSelectionDidChange: function() {
this.get('jsTreeActionReceiver').send('getSelected');
},

contextMenuReportClicked: function(node, tree) {
var self = this;
contextMenuReportClicked: function(node) {
this.set('lastItemClicked', '"Report" item for node: <' + node.text + '> was clicked.');
},

Expand Down
13 changes: 11 additions & 2 deletions tests/dummy/app/dynamic/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@
<div class="info">
<div class="status">
<h2>Tree Status</h2>
<p {{bind-attr class=":tree-status treeReady:tree-ready:tree-not-ready"}}>Tree Ready? <strong>{{#if treeReady}}Yes{{else}}No{{/if}}</strong></p>
<p class="tree-status {{if treeReady "tree-ready" "tree-not-ready"}}">
Tree Ready?
<strong>
{{#if treeReady}}
Yes
{{else}}
No
{{/if}}
</strong>
</p>
<p>Last Context Item Clicked: <strong>{{lastItemClicked}}</strong></p>
</div>

<div class="selected">
<h2>Selected Items</h2>
{{#if sortedSelectedNodes}}
<ul>
{{#each node in sortedSelectedNodes}}
{{#each sortedSelectedNodes as |node|}}
<li><strong>{{node.text}}</strong></li>
{{/each}}
</ul>
Expand Down
5 changes: 2 additions & 3 deletions tests/dummy/app/static/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ export default Ember.Controller.extend({
}
},

contextMenuReportClicked: function(node, tree) {
var self = this;
contextMenuReportClicked: function(node) {
this.set('lastItemClicked', '"Report" item for node: <' + node.text + '> was clicked.');
},

Expand All @@ -120,7 +119,7 @@ export default Ember.Controller.extend({
data[index].children.push('added child');
}
});
this.set(data);
this.set('data', data);
this.send('redraw');
},

Expand Down
13 changes: 11 additions & 2 deletions tests/dummy/app/static/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,24 @@
<div class="info">
<div class="status">
<h2>Tree Status</h2>
<p {{bind-attr class=":tree-status treeReady:tree-ready:tree-not-ready"}}>Tree Ready? <strong>{{#if treeReady}}Yes{{else}}No{{/if}}</strong></p>
<p class="tree-status {{if treeReady "tree-ready" "tree-not-ready"}}">
Tree Ready?
<strong>
{{#if treeReady}}
Yes
{{else}}
No
{{/if}}
</strong>
</p>
<p>Last Context Item Clicked: <strong>{{lastItemClicked}}</strong></p>
</div>

<div class="selected">
<h2>Selected Items</h2>
{{#if sortedSelectedNodes}}
<ul>
{{#each node in sortedSelectedNodes}}
{{#each sortedSelectedNodes as |node|}}
<li><strong>{{node.text}}</strong></li>
{{/each}}
</ul>
Expand Down
18 changes: 9 additions & 9 deletions tests/dummy/public/crossdomain.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->

<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>

<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>
1 change: 0 additions & 1 deletion tests/helpers/start-app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';

export default function startApp(attrs) {
Expand Down

0 comments on commit 7521d2b

Please sign in to comment.