ソースを参照

added function to search playlist by artist

AkiraLaine 9 年 前
コミット
cce60838d6
2 ファイル変更6 行追加1 行削除
  1. 5 0
      app/client/client.js
  2. 1 1
      app/client/templates/playlist.html

+ 5 - 0
app/client/client.js

@@ -1004,6 +1004,11 @@ Template.playlist.events({
                     $(el).parent(".pl-item").show();
                 }
             })
+            $(".pl-item #artist").each(function(i, el){
+                if($(el).text().toLowerCase().indexOf(input) !== -1){
+                    $(el).parent(".pl-item").show();
+                }
+            })
         }
     }
 })

+ 1 - 1
app/client/templates/playlist.html

@@ -6,7 +6,7 @@
             {{#if current}}<i class="fa fa-arrow-right"></i>{{/if}}
             <p style="float:right;padding-right:10px;font-weight:900">{{formatTime duration}}</p>
             <strong>{{title}}</strong>
-            <p>{{artist}}</p>
+            <p id="artist">{{artist}}</p>
         </li>
       {{/each}}
     </ul>