Skip to content

Commit

Permalink
updating styles
Browse files Browse the repository at this point in the history
  • Loading branch information
faridsabitov committed Mar 3, 2019
1 parent ff19bb6 commit 63ad220
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
31 changes: 20 additions & 11 deletions arrows.sketchplugin/Contents/Sketch/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion arrows.sketchplugin/Contents/Sketch/script.js.map

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,11 +824,22 @@ function setActiveStyleSetting(arrowStylingField){

if(docSettings){
// We have info about the settings in the current document
arrowStylingField.addItemWithTitle("Default Style")
for(let i = 0; i < styles.length; i++){
arrowStylingField.addItemWithTitle(styles[i].name())
if(styles[i].name() == docSettings){
arrowStylingField.lastItem().setState(1)

if(docSettings != "Default Style") {
// if user specified own option
arrowStylingField.addItemWithTitle(docSettings)
arrowStylingField.addItemWithTitle("Default Style")
for(let i = 0; i < styles.length; i++){
if(styles[i].name() != docSettings){
arrowStylingField.addItemWithTitle(styles[i].name())
}
}

} else {
// Need to show the default first
arrowStylingField.addItemWithTitle("Default Style")
for(let i = 0; i < styles.length; i++){
arrowStylingField.addItemWithTitle(styles[i].name())
}
}
} else {
Expand Down

0 comments on commit 63ad220

Please sign in to comment.