-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from xwp/try/masonary-2
Add masonry view to backbone
- Loading branch information
Showing
20 changed files
with
501 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
**/vendor/** | ||
**/assets/js/*.js | ||
build/* | ||
js/dist/* | ||
data/* | ||
built/* |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...or/views/collections/images_collection.js → ...selector/collections/images_collection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
.unsplash-browser.attachments-browser .media-toolbar-primary { | ||
float: none; | ||
max-width: 100%; | ||
margin: 20px 6px 5px; | ||
} | ||
|
||
.unsplash-browser.attachments-browser .media-toolbar { | ||
height: 100px; | ||
} | ||
|
||
.unsplash-browser.attachments-browser .unsplash-search-input-label { | ||
display: block; | ||
margin: 5px 0 0; | ||
} | ||
|
||
.unsplash-browser.attachments-browser .unplash-search { | ||
width: 100%; | ||
padding: 5px 10px; | ||
margin: 0; | ||
} | ||
|
||
.wp-core-ui .unsplash-browser .attachment-preview { | ||
box-shadow: none; | ||
background: none; | ||
} | ||
|
||
.wp-core-ui .unsplash-browser .attachment-preview::before { | ||
display: none; | ||
padding-top: 0; | ||
} | ||
|
||
.media-frame .unsplash-browser .no-media, | ||
.media-frame .unsplash-browser .attachments { | ||
position: absolute !important; | ||
height: auto !important; | ||
top: 100px; | ||
right: 310px; | ||
left: 10px; | ||
padding: 0; | ||
} | ||
|
||
.media-frame .unsplash-browser .no-media { | ||
right: 300px; | ||
text-align: center; | ||
left: 0; | ||
top: 35px; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment .thumbnail { | ||
margin: 12px; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment:focus .thumbnail, | ||
.wp-core-ui .selected.attachment:focus .thumbnail, | ||
.wp-core-ui .unsplash-attachment.details:focus .thumbnail { | ||
box-shadow: | ||
0 0 0 1px #fff, | ||
0 0 2px 3px #5b9dd9; | ||
|
||
/* Only visible in Windows High Contrast mode */ | ||
outline: 2px solid transparent; | ||
} | ||
|
||
.wp-core-ui .media-selection .selected.attachment .thumbnail { | ||
box-shadow: none; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment.details .thumbnail { | ||
box-shadow: | ||
0 0 0 1px #fff, | ||
0 0 0 3px #0073aa; | ||
} | ||
|
||
.media-frame .unsplash-browser .no-media img { | ||
width: 400px; | ||
} | ||
|
||
.wp-core-ui .unsplash-browser .unsplash-attachment img { | ||
min-width: 100%; | ||
max-width: 100%; | ||
vertical-align: top; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment .check { | ||
display: none; | ||
height: 24px; | ||
width: 24px; | ||
padding: 0; | ||
border: 0; | ||
position: absolute; | ||
z-index: 10; | ||
top: 2px; | ||
right: 2px; | ||
outline: none; | ||
background: #eee; | ||
cursor: pointer; | ||
box-shadow: 0 0 0 1px #fff, 0 0 0 2px rgba(0, 0, 0, 0.15); | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment .check .media-modal-icon { | ||
display: block; | ||
background-position: -1px 0; | ||
height: 15px; | ||
width: 15px; | ||
margin: 5px; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment .check:hover .media-modal-icon { | ||
background-position: -40px 0; | ||
} | ||
|
||
|
||
.wp-core-ui .unsplash-attachment.selected .check { | ||
display: block; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment.details .check, | ||
.wp-core-ui .unsplash-attachment.selected .check:focus, | ||
.wp-core-ui .media-frame.mode-grid .attachment.selected .check { | ||
background-color: #0073aa; | ||
box-shadow: | ||
0 0 0 1px #fff, | ||
0 0 0 2px #0073aa; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment.selected .check:focus { | ||
|
||
/* Only visible in Windows High Contrast mode */ | ||
outline: 2px solid transparent; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment.details .check .media-modal-icon, | ||
.wp-core-ui .media-frame.mode-grid .attachment.selected .check .media-modal-icon { | ||
background-position: -21px 0; | ||
} | ||
|
||
.wp-core-ui .unsplash-attachment.details .check:hover .media-modal-icon, | ||
.wp-core-ui .unsplash-attachment.selected .check:focus .media-modal-icon, | ||
.wp-core-ui .media-frame.mode-grid .attachment.selected .check:hover .media-modal-icon { | ||
background-position: -60px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const ImageView = wp.media.view.Attachment.extend( { | ||
className: 'unsplash-attachment', | ||
tagName: 'div', | ||
buttons: { | ||
check: true, | ||
}, | ||
} ); | ||
|
||
export default ImageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Macy from 'macy'; | ||
|
||
const ImageViews = wp.media.view.Attachments.extend( { | ||
className: 'attachments', | ||
tagName: 'div', | ||
macy: null, | ||
|
||
render() { | ||
wp.media.view.Attachments.prototype.render.apply( this, arguments ); | ||
this.refreshMacy(); | ||
}, | ||
ready() { | ||
this.setupMacy(); | ||
this.scroll(); | ||
}, | ||
setupMacy() { | ||
this.macy = Macy( { | ||
container: '#' + this.el.id, | ||
trueOrder: true, | ||
waitForImages: true, | ||
useContainerForBreakpoints: true, | ||
margin: 0, | ||
columns: 3, | ||
breakAt: { | ||
992: 3, | ||
768: 2, | ||
600: 1, | ||
}, | ||
} ); | ||
}, | ||
refreshMacy() { | ||
if ( this.macy ) { | ||
this.macy.recalculate(); | ||
} | ||
}, | ||
} ); | ||
|
||
export default ImageViews; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.