Skip to content

Commit

Permalink
Update Hide Unselected Layers.sketchplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bomberstudios committed Nov 26, 2015
1 parent 9c154a4 commit 5d1cbeb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Hide Unselected Layers.sketchplugin
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Hide Unselected Layers
var s = selection

var all_layers = [[doc currentPage] layers]
for (var i = 0; i < [all_layers count]; i++) {
var current_layer = [all_layers objectAtIndex:i]
if(![selection containsObject:current_layer]){
[current_layer setIsVisible:false]
var all_layers = context.document.currentPage().children()
for (var i = 0; i < all_layers.count(); i++) {
var current_layer = all_layers.objectAtIndex(i)
if(!context.selection.containsObject(current_layer)){
if(current_layer.className() != "MSArtboardGroup"){
current_layer.setIsVisible(false)
}
}
}

0 comments on commit 5d1cbeb

Please sign in to comment.