Skip to content

Commit

Permalink
Merge pull request #32 from baylee-d/feature/style-changes
Browse files Browse the repository at this point in the history
Styling changes for file versions and share popup
  • Loading branch information
jamescdavis committed Nov 13, 2017
2 parents f901d9f + fb234b0 commit bc53379
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
21 changes: 21 additions & 0 deletions app/file-detail/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { computed } from '@ember/object';
import { A } from '@ember/array';
import Controller from '@ember/controller';
import { mimeTypes } from 'ember-osf/const/mime-types';
import outsideClick from 'ember-osf/utils/outside-click';

export default Controller.extend({
currentUser: service(),
toast: service(),
revision: null,
deleteModalOpen: false,
showPopup: false,
displays: A([]),

canDelete: computed.alias('canEdit'),
Expand Down Expand Up @@ -167,6 +169,25 @@ export default Controller.extend({
versionChange(version) {
this.set('revision', version);
},

togglePopup() {
this.toggleProperty('showPopup');
},

dismissToggle() {
this.set('showPopup', false);
},
},

init() {
this._super(...arguments);
outsideClick(function() {
this.send('dismissToggle');
}.bind(this));

$(window).resize(function() {
this.send('dismissToggle');
}.bind(this));
},

_returnFileVersion(result) {
Expand Down
16 changes: 8 additions & 8 deletions app/file-detail/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</div>
{{/if}}
<div class='btn-group m-l-xs m-t-xs'>
<button class='btn btn-sm btn-default popover-toggler'>
<button class='btn btn-sm btn-default popover-toggler' {{action 'togglePopup'}}>
Share
{{#bs-popover placement='bottom' class='share-popover' title='Share'}}
{{#bs-popover placement='bottom' class='share-popover' title='Share' visible=showPopup}}
{{#bs-tab customTabs=true as |tab|}}
{{#bs-nav class='nav-justified' type='tabs' as |nav|}}
{{#nav.item active=(bs-eq tab.activeId 'sharePane')}}
Expand Down Expand Up @@ -105,7 +105,7 @@
{{#modal.body}}
<p>Are you sure you want to delete <b>{{model.file.name}}</b>?</p>
{{/modal.body}}
{{#modal.footer as |footer|}}
{{#modal.footer}}
{{#bs-button onClick=(action 'closeDeleteModal') type='default'}}Cancel{{/bs-button}}
{{#bs-button onClick=(action modal.submit) type='danger'}}Delete{{/bs-button}}
{{/modal.footer}}
Expand Down Expand Up @@ -181,11 +181,11 @@
<table class='table table-responsive'>
<thead>
<tr>
<th>Version ID</th>
<th>Date</th>
<th colspan='2'>Download</th>
<th>MD5</th>
<th>SHA2</th>
<th class='col-md-4'>Version ID</th>
<th class='col-md-6'>Date</th>
<th colspan='2' class='col-xs-2'>Download</th>
<th class='hidden-md hidden-sm hidden-xs'>MD5</th>
<th class='hidden-md hidden-sm hidden-xs'>SHA2</th>
</tr>
</thead>
<tbody>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"*.js": "eslint"
},
"devDependencies": {
"@centerforopenscience/ember-osf": "https://github.com/CenterForOpenScience/ember-osf.git#develop#2017-10-30T15:10:59Z",
"@centerforopenscience/ember-osf": "https://github.com/CenterForOpenScience/ember-osf.git#develop#2017-11-13T14:21:47Z",
"@centerforopenscience/eslint-config": "^2.0.0",
"@centerforopenscience/osf-style": "1.5.1",
"bootstrap": "^3.3.7",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# yarn lockfile v1


"@centerforopenscience/ember-osf@https://github.com/CenterForOpenScience/ember-osf.git#develop#2017-10-30T15:10:59Z":
"@centerforopenscience/ember-osf@https://github.com/CenterForOpenScience/ember-osf.git#develop#2017-11-13T14:21:47Z":
version "0.12.0"
resolved "https://github.com/CenterForOpenScience/ember-osf.git#9ca9f02862d94b756ac9e1d03c26e786fdf01aad"
resolved "https://github.com/CenterForOpenScience/ember-osf.git#f199f9a9af6ccea4b80046c18831d9279b64c0fe"
dependencies:
broccoli-funnel "1.2.0"
broccoli-merge-trees "2.0.0"
Expand Down

0 comments on commit bc53379

Please sign in to comment.