Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bomberstudios committed Dec 11, 2019
1 parent e99883e commit e7fa4aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
15 changes: 9 additions & 6 deletions src/artboard-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,20 @@ export function InsertArtboard(context){
}
}

export function ToggleAutoMode(){
export function ToggleAutoMode(context){
let autoMode = Settings.settingForKey("autoMode")
Settings.setSettingForKey("autoMode", !autoMode)
autoMode = Settings.settingForKey("autoMode")
checkMarkMenu()
UI.message(`Artboard Manager: Auto Mode ${Settings.settingForKey("autoMode") ? "enabled" : "disabled"}`)
UI.message(`Artboard Manager: Auto Mode ${autoMode ? "enabled" : "disabled"}`)
if (autoMode) {
// console.log('Auto Mode is enabled, so lets arrange the Artboards')
ArrangeArtboards(context)
}
}

export function ArrangeArtboards(context) {
if (!config.autoMode) {
return
}
if (Settings.settingForKey("autoMode") == false) { return }
const doc = sketch.getSelectedDocument()
const page = doc.selectedPage
const symbolsPage = doc._object.documentData().symbolsPage()
Expand Down Expand Up @@ -198,7 +201,7 @@ export function ArrangeArtboards(context) {

// Restore original selection
originalSelection.forEach(artboard => artboard.selected = true)
console.log('Artboards arranged')
// console.log('Artboards arranged')
}

function snapValueToGrid(value, grid) {
Expand Down
2 changes: 1 addition & 1 deletion src/artboard-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ArtboardSettings(context) {
const options = {
identifier: "artboardManagerSettings",
width: 350,
height: 306,
height: 280,
show: false,
resizable: false,
title: "Artboard Manager — Settings",
Expand Down
1 change: 0 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"Duplicate.finish": "Duplicate",
"HandlerLostFocus": "Resize",
"ResizeArtboardToFit": "ResizeArtboardToFit",
"InsertArtboard.finish": "InsertArtboard",
"onDocumentChanged": "onDocumentChanged"
}
},
Expand Down

0 comments on commit e7fa4aa

Please sign in to comment.