瀏覽代碼

Feature: Add star button for specified pin

pull/169/head
winkidney 5 年之前
committed by Isaac Bythewood
父節點
當前提交
9b592ebac6
共有 3 個檔案被更改,包括 17 行新增13 行删除
  1. +3
    -3
      pinry/static/css/pinry.css
  2. +3
    -3
      pinry/static/js/pinry.js
  3. +11
    -7
      pinry/templates/includes/pins.html

+ 3
- 3
pinry/static/css/pinry.css 查看文件

@@ -190,7 +190,7 @@ textarea {
width: 240px;
}

.pin .editable {
.pin .editor {
background: rgba(255, 255, 255, 0.4);
border: 2px solid rgba(255, 255, 255, 0.4);
-webkit-border-radius: 4px;
@@ -202,11 +202,11 @@ textarea {
color: white;
}

.pin:hover .editable {
.pin:hover .editor {
display: block;
}

.pin .editable .borderable {
.pin .editor .borderable {
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;


+ 3
- 3
pinry/static/js/pinry.js 查看文件

@@ -78,12 +78,12 @@ $(window).load(function() {
// Show edit-buttons only on mouse over
$('.pin').each(function(){
var thisPin = $(this);
thisPin.find('.editable').hide();
thisPin.find('.editor').hide();
thisPin.off('hover');
thisPin.hover(function() {
thisPin.find('.editable').stop(true, true).fadeIn(300);
thisPin.find('.editor').stop(true, true).fadeIn(300);
}, function() {
thisPin.find('.editable').stop(true, false).fadeOut(300);
thisPin.find('.editor').stop(true, false).fadeOut(300);
});
});



+ 11
- 7
pinry/templates/includes/pins.html 查看文件

@@ -2,16 +2,20 @@
<script id="pins-template" type="text/x-handlebars-template">
{{#each pins}}
<div class="pin" data-id="{{id}}">
<div class="editor">
<div class="borderable">
<span class="glyphicon glyphicon-heart" data-id="{{id}}"></span>
</div>
{{#if editable}}
<div class="editable">
<div class="borderable">
<span class="glyphicon glyphicon-trash" data-id="{{id}}"></span>
</div>
<div class="borderable">
<span class="glyphicon glyphicon-pencil" data-id="{{id}}"></span>
</div>
<div class="borderable">
<span class="glyphicon glyphicon-trash" data-id="{{id}}"></span>
</div>
<div class="borderable">
<span class="glyphicon glyphicon-pencil" data-id="{{id}}"></span>
</div>
{{/if}}
</div>

<a href="{{image.standard.image}}" class="lightbox" data-id="{{id}}">
<div class="image-wrapper" style="width: {{image.thumbnail.width}}px; height: {{image.thumbnail.height}}px;">
<img src="{{image.thumbnail.image}}" width="{{image.thumbnail.width}}" height="{{image.thumbnail.height}}"/>


Loading…
取消
儲存