diff options
author | danielgrippi <danielgrippi@gmail.com> | 2012-02-14 02:12:14 +0400 |
---|---|---|
committer | danielgrippi <danielgrippi@gmail.com> | 2012-02-14 02:12:14 +0400 |
commit | f1c119452a9502e7aaea45d464d2563e81f86866 (patch) | |
tree | 3546f268787cdb041c92fa4905f874c9b307a792 /public | |
parent | ab29a58f93f19bcaeb4dac5812729ec6cc3c6e72 (diff) |
made nsfw shield nicer and more condensed [ci skip]
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/app/templates/stream-element.handlebars | 30 | ||||
-rw-r--r-- | public/javascripts/app/views/post_view.js | 9 | ||||
-rw-r--r-- | public/stylesheets/sass/application.sass | 15 |
3 files changed, 23 insertions, 31 deletions
diff --git a/public/javascripts/app/templates/stream-element.handlebars b/public/javascripts/app/templates/stream-element.handlebars index ff85e9271..7af3c8872 100644 --- a/public/javascripts/app/templates/stream-element.handlebars +++ b/public/javascripts/app/templates/stream-element.handlebars @@ -45,23 +45,23 @@ </div> {{#if nsfw}} - <div class="shield_wrapper"> - <div class="shield"> - {{t "stream.nsfw"}} - <a href="#"> - {{t "stream.show"}} - </a> - </div> - {{/if}} + <div class="nsfw-shield"> + <strong> + NSFW + </strong> + | + <a href="#"> + {{t "stream.show_post"}} + </a> + </div> - <div class="post-content"> </div> + {{else}} - {{#if nsfw}} - </div> - {{/if}} + <div class="post-content"> </div> - <div class="feedback"> </div> - <div class="likes"> </div> - <div class="comments"> </div> + <div class="feedback"> </div> + <div class="likes"> </div> + <div class="comments"> </div> + {{/if}} </div> diff --git a/public/javascripts/app/views/post_view.js b/public/javascripts/app/views/post_view.js index c722ceed8..9d93b28ba 100644 --- a/public/javascripts/app/views/post_view.js +++ b/public/javascripts/app/views/post_view.js @@ -1,12 +1,12 @@ app.views.Post = app.views.StreamObject.extend({ - + templateName: "stream-element", className : "stream_element loaded", events: { "click .focus_comment_textarea": "focusCommentTextarea", - "click .shield a": "removeNsfwShield", + "click .nsfw-shield a": "removeNsfwShield", "click .remove_post": "destroyModel", "click .hide_post": "hidePost", "click .block_user": "blockUser" @@ -55,9 +55,8 @@ app.views.Post = app.views.StreamObject.extend({ removeNsfwShield: function(evt){ if(evt){ evt.preventDefault(); } - - $(evt.target).parent(".shield").remove(); - + this.model.set({nsfw : false}) + this.render(); return this; }, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8e7c31ac5..fc59097e2 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -2786,20 +2786,13 @@ a.toggle_selector &:hover @include opacity(1) -.shield +.nsfw-shield @include border-radius(3px) - :z-index 3 :background-color #eee - :position absolute - :width 100% - :min-height 100% - :padding 5px + :width 90% + :padding 5px 10px :border 1px solid #ddd - -.shield_wrapper - :position relative - :margin - :bottom 15px + :color #999 #back-to-top :display block |