diff options
| author | Julie Lala <jules@okfoc.us> | 2014-10-14 20:00:59 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-10-14 20:33:29 -0400 |
| commit | 1b152e66ad8d7aa1c5511152991e648308f8918b (patch) | |
| tree | fafbf1de89a147adf8f79b1f866c023a63a09482 /public/assets/javascripts/ui/editor/MediaViewer.js | |
| parent | 527a65ca570891ff473dbdac36d41b1be60196f1 (diff) | |
fixed-position close box
fixed-position close box &c
Diffstat (limited to 'public/assets/javascripts/ui/editor/MediaViewer.js')
| -rw-r--r-- | public/assets/javascripts/ui/editor/MediaViewer.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/public/assets/javascripts/ui/editor/MediaViewer.js b/public/assets/javascripts/ui/editor/MediaViewer.js index 2e76bec..10819af 100644 --- a/public/assets/javascripts/ui/editor/MediaViewer.js +++ b/public/assets/javascripts/ui/editor/MediaViewer.js @@ -6,6 +6,7 @@ var MediaViewer = ModalView.extend({ loaded: false, perPage: 12, offset: 0, + fixedClose: true, events: { 'mousedown': "stopPropagation", @@ -106,6 +107,7 @@ var MediaViewer = ModalView.extend({ }, populate: function(data){ + var scrollTop = this.loaded ? $('.myMedia .container').height() : 0 if (data && data.length) { if (data.length < this.perPage) { this.$viewMore.hide() @@ -122,8 +124,13 @@ var MediaViewer = ModalView.extend({ this.$noMedia.show() this.$deleteMedia.hide() } - this.loaded = true - this.__super__.show.call(this) + if (this.loaded) { + this.$el.delay(300).animate({ scrollTop: scrollTop }, 200) + } + else { + this.loaded = true + this.__super__.show.call(this) + } }, addUploadedMedia: function(media){ |
