Skip to content

Commit

Permalink
Drop support for using a Ember View as a target
Browse files Browse the repository at this point in the history
- If you need to view support, use the 1.0.0 release
  • Loading branch information
lukemelia committed Apr 5, 2017
1 parent 52ef7c8 commit 0d0649a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 88 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ This can then be used like so:

* `ember install ember-modal-dialog`

## Running the dumy app
## Running the dummy app

* `ember server`
* Visit your app at http://localhost:4200.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
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
27 changes: 1 addition & 26 deletions tests/dummy/app/templates/-tether-dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -135,31 +135,6 @@
{{/if}}
</div>

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

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

0 comments on commit 0d0649a

Please sign in to comment.