Skip to content

Commit

Permalink
Merge pull request #172 from yapplabs/chore/drop-old-ember-support
Browse files Browse the repository at this point in the history
Drop support for Ember versions older than 2.4
  • Loading branch information
lukemelia authored Apr 5, 2017
2 parents 3b07c8d + 0d0649a commit d817425
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 247 deletions.
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ ember install ember-modal-dialog
ember install ember-cli-sass
```

*Note:* Ember CLI versions < 0.2.3 should use `ember install:addon` instead of `ember install`

**app.scss**
```scss
@import "ember-modal-dialog/ember-modal-structure";
Expand Down Expand Up @@ -196,18 +194,14 @@ The addon packages default styles for modal structure and appearance. To use the
> ember install ember-cli-sass
```

Or, in Ember CLI versions < 0.2.3:

```sh
ember install:addon ember-cli-sass
```

**app.scss**
```scss
@import "ember-modal-dialog/ember-modal-structure";
@import "ember-modal-dialog/ember-modal-appearance";
```

If you would prefer not to use Sass, just grab the contents of these files and adapt them for your needs -- there is not much there.

## Keyboard shortcuts

A quick-and-dirty way to implement keyboard shortcuts (e.g. to dismiss your modals with `escape`) is to subclass the dialog and attach keyboard events:
Expand Down Expand Up @@ -283,20 +277,14 @@ This can then be used like so:

## Dependencies

* Requires Ember CLI >= 0.2.0
* Requires Ember >= 1.10.0 (Due to a bug in these versions of Ember, you may have trouble with Ember 1.13.7, 1.13.8 and 1.13.9 -- See #71)
* For Ember versions >= 2.4, use the latest published version
* For Ember versions >= 1.10 and < 2.4, use ember-modal-dialog 1.0.0 _(Due to a bug in these versions of Ember, you may have trouble with Ember 1.13.7, 1.13.8 and 1.13.9 -- See #71)_

## Installation

* `ember install ember-modal-dialog`

Or, in Ember CLI versions < 0.2.3:

```sh
ember install:addon ember-modal-dialog
```

## Running
## Running the dummy app

* `ember server`
* Visit your app at http://localhost:4200.
Expand Down Expand Up @@ -330,5 +318,5 @@ This project uses [https://github.com/skywinder/github-changelog-generator](http

## Credits

Contributions from @stefanpenner, @krisselden, @chrislopresto, @lukemelia, @raycohen and
Contributions from @stefanpenner, @krisselden, @chrislopresto, @lukemelia, @raycohen, @andrewhavens, @samselikoff and
others. [Yapp Labs](http://yapplabs.com) is an Ember.js consultancy based in NYC.
File renamed without changes.
15 changes: 0 additions & 15 deletions addon/templates/lt-1-13/components/modal-dialog.hbs

This file was deleted.

29 changes: 0 additions & 29 deletions addon/templates/lt-1-13/components/tether-dialog.hbs

This file was deleted.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ember-modal-dialog",
"dependencies": {
"bind-polyfill": "^1.0.0",
"ember": "~2.6.0",
"ember": "~2.4.6",
"ember-cli-shims": "0.1.1",
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0"
Expand Down
65 changes: 0 additions & 65 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,3 @@
module.exports = {
useVersionCompatibility: true
// scenarios: [
// {
// name: 'default',
// dependencies: { }
// },
// {
// name: '1.10.1',
// dependencies: {
// 'ember': '1.10.1',
// 'ember-load-initializers': 'ember-cli/ember-load-initializers#0.0.2'
// }
// },
// {
// name: '1.11.3',
// dependencies: {
// 'ember': '1.11.3',
// 'ember-load-initializers': 'ember-cli/ember-load-initializers#0.0.2'
// }
// },
// {
// name: '1.12.1',
// dependencies: {
// 'ember': '1.12.1'
// }
// },
// {
// name: '1.13.10',
// dependencies: {
// 'ember': '1.13.10'
// }
// },
// {
// name: '2.4.5',
// dependencies: {
// 'ember': '2.4.5'
// }
// },
// {
// name: 'ember-release',
// dependencies: {
// 'ember': 'components/ember#release'
// },
// resolutions: {
// 'ember': 'release'
// }
// },
// {
// name: 'ember-beta',
// dependencies: {
// 'ember': 'components/ember#beta'
// },
// resolutions: {
// 'ember': 'beta'
// }
// },
// {
// name: 'ember-canary',
// dependencies: {
// 'ember': 'components/ember#canary'
// },
// resolutions: {
// 'ember': 'canary'
// }
// }
// ]
};
30 changes: 1 addition & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,6 @@
var path = require('path');
var fs = require('fs');

var VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: 'ember-modal-dialog',

init: function() {
this._super.init && this._super.init.apply(this, arguments);
var checker = new VersionChecker(this);

if (!checker.forEmber().isAbove('0.2.6')) {
console.warn("Warning: ember-modal-dialog requires ember-cli >= 0.2.6 "
+ "for support for the addon-templates tree, which allows "
+ "us to support various ember versions. Use an older "
+ "version of ember-modal-dialog if you are stuck on an "
+ "older ember-cli.");
}
},

treeForAddonTemplates: function treeForAddonTemplates (tree) {
var checker = new VersionChecker(this);
var emberVersion = checker.forEmber();

var baseTemplatesPath = path.join(this.root, 'addon/templates');

if (emberVersion.lt('1.13.0-beta.1')) {
return this.treeGenerator(path.join(baseTemplatesPath, 'lt-1-13'));
} else {
return this.treeGenerator(path.join(baseTemplatesPath, 'current'));
}
}
name: 'ember-modal-dialog'
};
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"repository": "https://github.com/yapplabs/ember-modal-dialog",
"engines": {
"node": ">= 0.10.0"
"node": ">= 4"
},
"author": "",
"license": "MIT",
Expand All @@ -36,7 +36,6 @@
"ember-disable-prototype-extensions": "^1.1.0",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.5",
"ember-legacy-views": "0.2.0",
"ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3",
"ember-suave": "1.2.3",
Expand All @@ -47,7 +46,6 @@
"dependencies": {
"ember-cli-babel": "^5.1.6",
"ember-cli-htmlbars": "^1.0.8",
"ember-cli-version-checker": "^1.2.0",
"ember-wormhole": "~0.3.6"
},
"keywords": [
Expand All @@ -57,7 +55,7 @@
"configPath": "tests/dummy/config",
"demoURL": "http://yapplabs.github.io/ember-modal-dialog/",
"versionCompatibility": {
"ember": ">1.11.0"
"ember": "~2.4.0 || > 2.8.0"
}
}
}
8 changes: 0 additions & 8 deletions tests/acceptance/modal-dialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ test('target - element', function(assert) {
});
});

test('target - view', function(assert) {
assert.dialogOpensAndCloses({
openSelector: '#example-target-view button',
dialogText: 'Target - View',
closeSelector: dialogCloseButton
});
});

test('subclassed modal', function(assert) {
assert.dialogOpensAndCloses({
openSelector: '#example-subclass button',
Expand Down
9 changes: 0 additions & 9 deletions tests/acceptance/tether-dialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,6 @@ test('target - element', function(assert) {
});
});

test('target - view', function(assert) {
assert.dialogOpensAndCloses({
openSelector: '#example-target-view button',
dialogText: 'Target - View',
closeSelector: dialogCloseButton,
hasOverlay: false
});
});

test('subclassed modal', function(assert) {
assert.dialogOpensAndCloses({
openSelector: '#example-subclass button',
Expand Down
18 changes: 0 additions & 18 deletions tests/dummy/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default Ember.Controller.extend({
isShowingWithoutOverlayClickOutsideToCloseAnotherOne: false,
isShowingCustomStyles: false,
isShowingTargetSelector: false,
isShowingTargetView: false,
isShowingTargetElement: false,
isShowingSubclassed: false,
isShowingInPlace: false,
Expand Down Expand Up @@ -76,18 +75,6 @@ export default Ember.Controller.extend({
}
this.toggleProperty('isShowingTargetSelector');
},
toggleTargetView() {
if (this.get('isShowingTargetView')) {
let newTargetAttachment = this.nextAttachment(this.get('exampleTargetAttachment'));
let newAttachment = this.nextAttachment(this.get('exampleAttachment'));
this.set('exampleTargetAttachment', newTargetAttachment);
this.set('exampleAttachment', newAttachment);
if (newTargetAttachment !== 'middle left') {
return;
}
}
this.toggleProperty('isShowingTargetView');
},
toggleTargetElement() {
if (this.get('isShowingTargetElement')) {
let newTargetAttachment = this.nextAttachment(this.get('exampleTargetAttachment'));
Expand Down Expand Up @@ -133,11 +120,6 @@ export default Ember.Controller.extend({
this.set('exampleTargetAttachment', 'middle left');
this.set('exampleAttachment', 'middle right');
},
closeTargetView() {
this.set('isShowingTargetView', false);
this.set('exampleTargetAttachment', 'middle left');
this.set('exampleAttachment', 'middle right');
},
closeTargetElement() {
this.set('isShowingTargetElement', false);
this.set('exampleTargetAttachment', 'middle left');
Expand Down
26 changes: 1 addition & 25 deletions tests/dummy/app/templates/-modal-dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,6 @@
{{/if}}
</div>

<div class='example' id='example-target-view'>
<h2>Target (View)</h2>
<div class='targetContainer'>
<span id="bwmdv">
<button {{action 'toggleTargetView'}}>Do It</button>
</span>
</div>
{{code-snippet name='target-view-modal-dialog.hbs'}}
{{#if isShowingTargetView}}
{{!-- BEGIN-SNIPPET target-view-modal-dialog --}}
{{#modal-dialog close='toggleTargetView'
targetAttachment=exampleTargetAttachment
attachment=exampleAttachment
target="#bwmdv" }}
<h1>Stop! Modal Time!</h1>
<p>Target - View: {{view.bwmdv}}</p>
<p>Target Attachment: {{exampleTargetAttachment}}</p>
<p>Attachment: {{exampleAttachment}}</p>
<button {{action 'closeTargetView'}}>Close</button>
{{/modal-dialog}}
{{!-- END-SNIPPET --}}
{{/if}}
</div>

<div class='example' id='example-target-element'>
<h2>Target (Element)</h2>
<div class='targetContainer'>
Expand All @@ -126,7 +102,7 @@
attachment=exampleAttachment
target="#bwmde" }}
<h1>Stop! Modal Time!</h1>
<p>Target - Element{{view.bwmde.elementId}}</p>
<p>Target - Element #bwmde</p>
<p>Target Attachment: {{exampleTargetAttachment}}</p>
<p>Attachment: {{exampleAttachment}}</p>
<button {{action 'closeTargetElement'}}>Close</button>
Expand Down
Loading

0 comments on commit d817425

Please sign in to comment.