Skip to content

Commit

Permalink
merge update branch
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierchatry committed Oct 19, 2017
2 parents 4f4df33 + 7a0cb6f commit 4732d71
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 46 deletions.
2 changes: 1 addition & 1 deletion addon/create-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function(bindEvent, unbindEvent) {
mousetrap = new Mousetrap(document.body);
} else if (actionObject.scoped) {
if (Ember.typeOf(actionObject.scoped) === 'boolean') {
mousetrap = new Mousetrap(self.get('element'));
mousetrap = new Mousetrap(this.get('element'));
} else if (Ember.typeOf(actionObject.scoped) === 'string') {
mousetrap = new Mousetrap(document.querySelector(actionObject.scoped));
}
Expand Down
20 changes: 0 additions & 20 deletions bower.json

This file was deleted.

32 changes: 24 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
/* jshint node: true */
'use strict';
var path = require('path');
var resolve = require('resolve');
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
var fastbootTransform = require('fastboot-transform');

module.exports = {
name: 'ember-keyboard-shortcuts',

included: function(app) {
this._super.included.apply(this, arguments);
if (typeof app.import !== 'function' && app.app) {
app = app.app;
}
if (typeof app.import !== 'function' && app.app) {
app = app.app;
app.import('vendor/mousetrap/mousetrap.js');
},

treeForVendor: function(tree) {
var trees = [];
var mousetrap = fastbootTransform(new Funnel(this.pathBase('mousetrap'), {
destDir: 'mousetrap'
}));
trees = trees.concat([mousetrap]);
if (tree) {
trees.push(tree);
}
app.import(app.bowerDirectory + '/mousetrap/mousetrap.js');
}
};
return mergeTrees(trees);
},

pathBase: function(packageName) {
return path.dirname(resolve.sync(packageName + '/package.json', { basedir: __dirname }));
},
};
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-keyboard-shortcuts",
"version": "0.3.4",
"version": "0.3.0",
"directories": {
"doc": "doc",
"test": "tests"
Expand Down Expand Up @@ -30,31 +30,33 @@
"author": "Trym Skaar <[email protected]>",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.2",
"ember-cli": "0.2.3",
"ember-cli-app-version": "0.3.3",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "0.0.8",
"ember-cli-htmlbars": "0.7.4",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.10",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.16.1",
"ember-export-application-global": "^1.0.2",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-try": "0.0.4"
"broccoli-asset-rev": "~2.6.0",
"ember-cli": "~2.16.2",
"ember-source": "~2.16.0",
"ember-cli-app-version": "~3.1.0",
"ember-cli-content-security-policy": "~1.0.0",
"ember-cli-dependency-checker": "~2.0.1",
"ember-cli-htmlbars": "~2.0.3",
"ember-cli-ic-ajax": "~1.0.0",
"ember-cli-inject-live-reload": "~1.7.0",
"ember-cli-qunit": "~4.0.1",
"ember-cli-uglify": "~2.0.0",
"ember-export-application-global": "~2.0.0",
"ember-disable-prototype-extensions": "~1.1.3",
"ember-try": "~0.2.17"
},
"description": "ember-cli addon that uses mousetrap to facilitate keyboard shortcuts",
"keywords": [
"ember-addon",
"mousetrap"
],
"dependencies": {
"ember-cli-babel": "^5.0.0"
"ember-cli-babel": "~6.8.2",
"mousetrap": "~1.6.1",
"fastboot-transform": "~0.1.2"
},
"ember-addon": {
"configPath": "tests/dummy/config",
"defaultBlueprint": "ember-keyboard-shortcuts"
}
}
}

0 comments on commit 4732d71

Please sign in to comment.