Skip to content
This repository was archived by the owner on Aug 27, 2018. It is now read-only.

Commit 79960ee

Browse files
committed
Some fixes
1 parent 28c8c40 commit 79960ee

File tree

8 files changed

+33
-29
lines changed

8 files changed

+33
-29
lines changed

3-panel/src/imports/materialdesign/components/Dialog/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ export default class Dialog extends Component {
3737
this.toggled = true
3838

3939
root.style.display = 'block'
40+
4041
setTimeout(function () {
4142
root.style.opacity = '1'
4243
root.style.top = '50%'
43-
}, 10)
44+
}, 20)
4445

4546
this.toggleDark(true)
4647
} else {
@@ -70,7 +71,7 @@ export default class Dialog extends Component {
7071

7172
setTimeout(function () {
7273
dark.style.opacity = opacity
73-
}, 10)
74+
}, 20)
7475
} else {
7576
dark.style.opacity = '0'
7677

3-panel/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import UI from './helpers/UI'
44
import './styles.scss'
55

66
// Wait for sass load.
7-
setTimeout(function () {
7+
window.onload = function () {
88
UI.render(new App(), document.getElementById('app'))
9-
}, 1)
9+
}

3-panel/src/views/App/index.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,11 @@ export default class App extends Component {
383383
if (this.selectedPage === postsPage) {
384384
postsPage.onDeletePostsButtonClick
385385
} else if (this.selectedPage === galleryPage && galleryPage.elements.picturesDialog.toggledDeleteMode) {
386-
const dialog = this.elements.deletePicturesDialog
386+
const picturesDialog = galleryPage.elements.picturesDialog
387387

388-
dialog.elements.dialog.toggle(true)
388+
if (picturesDialog.selectedPictures.length > 0) {
389+
this.elements.deletePicturesDialog.elements.dialog.toggle(true)
390+
}
389391
}
390392
}
391393

@@ -419,15 +421,17 @@ export default class App extends Component {
419421
<EditCategoryDialog ref='editCategoryDialog' />
420422
<DeleteCategoryDialog ref='deleteCategoryDialog' />
421423
<DeletePicturesDialog ref='deletePicturesDialog' />
422-
<Snackbar ref='deletedPostsSnackbar' text='Pomyślnie usunięto posty' />
423-
<Snackbar ref='deletedPostSnackbar' text='Pomyślnie usunięto post' />
424-
<Snackbar ref='addedPostSnackbar' text='Pomyślnie dodano post' />
425-
<Snackbar ref='addedCategorySnackbar' text='Pomyślnie dodano kategorię' />
426-
<Snackbar ref='editedCategorySnackbar' text='Pomyślnie edytowano kategorię' />
427-
<Snackbar ref='addedPicturesSnackbar' text='Pomyślnie dodano zdjęcia' />
428-
<Tooltip ref='tooltipView' text='Przełącz na liste' />
429-
<Tooltip ref='tooltipShowPictures' text='Pokaż zdjęcia' />
430-
<Tooltip ref='tooltipUploadButton' text='Najlepiej w proporcjach 16:9' />
424+
<Snackbar ref='deletePostsSnackbar' text='Pomyślnie usunięto posty' />
425+
<Snackbar ref='deletePostSnackbar' text='Pomyślnie usunięto post' />
426+
<Snackbar ref='addPostSnackbar' text='Pomyślnie dodano post' />
427+
<Snackbar ref='addCategorySnackbar' text='Pomyślnie dodano kategorię' />
428+
<Snackbar ref='editCategorySnackbar' text='Pomyślnie edytowano kategorię' />
429+
<Snackbar ref='deleteCategorySnackbar' text='Pomyślnie usunięto kategorię' />
430+
<Snackbar ref='addPicturesSnackbar' text='Pomyślnie dodano zdjęcia' />
431+
<Snackbar ref='deletePicturesSnackbar' text='Pomyślnie usunięto zdjęcia' />
432+
<Tooltip ref='viewTooltip' text='Przełącz na liste' />
433+
<Tooltip ref='showPicturesTooltip' text='Pokaż zdjęcia' />
434+
<Tooltip ref='uploadButtonTooltip' text='Najlepiej w proporcjach 16:9' />
431435
<NavigationDrawer ref='navigationDrawer' />
432436
<Preloader className='data-preloader' ref='preloader' />
433437
</div>

3-panel/src/views/Pages/Gallery/components/AddCategoryDialog/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default class AddCategoryDialog extends Component {
5959

6060
const app = window.app
6161

62-
const snackbar = window.app.elements.addedCategorySnackbar
6362
const gallery = app.getGalleryPage()
6463
const date = new Date()
6564

@@ -89,7 +88,7 @@ export default class AddCategoryDialog extends Component {
8988
dialog.toggle(false)
9089
textField.setValue('')
9190
self.setDialogItems()
92-
snackbar.toggle(true)
91+
app.elements.addCategorySnackbar
9392
}, 500)
9493
}
9594
}

3-panel/src/views/Pages/Gallery/components/DeleteCategoryDialog/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export default class AddCategoryDialog extends Component {
4545
const root = this.getRoot()
4646
const dialog = this.elements.dialog
4747

48-
const gallery = window.app.getGalleryPage()
48+
const app = window.app
49+
50+
const gallery = app.getGalleryPage()
4951
const clickedPost = gallery.clickedCategory
5052
const index = gallery.categoriesData.indexOf(clickedPost.props.data)
5153

@@ -54,15 +56,15 @@ export default class AddCategoryDialog extends Component {
5456
dialog.setItems([])
5557

5658
setTimeout(function () {
59+
root.classList.remove('category-dialog-preloader')
60+
5761
gallery.categoriesData[index].removed = true
5862

5963
gallery.reloadSections()
60-
61-
root.classList.remove('category-dialog-preloader')
62-
6364
self.setDialogItems()
64-
6565
dialog.toggle(false)
66+
67+
app.elements.deleteCategorySnackbar.toggle(true)
6668
}, 500)
6769
}
6870

3-panel/src/views/Pages/Gallery/components/DeletePicturesDialog/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ export default class DeletePicturesDialog extends Component {
7171
root.classList.remove('category-dialog-preloader')
7272

7373
picturesDialog.toggleDeleteMode(false)
74-
74+
picturesDialog.setPicturesCount()
7575
self.setDialogItems()
7676
dialog.toggle(false)
77+
app.elements.deletePicturesSnackbar.toggle(true)
7778
}, 500)
7879
}
7980

3-panel/src/views/Pages/Gallery/components/EditCategoryDialog/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,10 @@ export default class EditCategoryDialog extends Component {
8282
categoriesData[index].name = title
8383
clickedCategory.elements.title.innerHTML = title
8484

85-
const snackbar = app.elements.editedCategorySnackbar
86-
8785
dialog.toggle(false)
8886
textField.setValue('')
8987
self.setDialogItems()
90-
snackbar.toggle(true)
88+
app.elements.editCategorySnackbar.toggle(true)
9189
}, 500)
9290
}
9391
}

3-panel/src/views/Pages/Gallery/components/UploadPicturesDialog/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@ export default class UploadPicturesDialog extends Component {
148148
console.log('Index is less than 0')
149149
}
150150

151-
picturesDialog.setPicturesCount()
151+
if (picturesDialog.toggled) picturesDialog.setPicturesCount()
152152

153153
this.toggle(false)
154-
155-
app.elements.addedPicturesSnackbar.toggle(true)
154+
app.elements.addPicturesSnackbar.toggle(true)
156155
}
157156

158157
/**

0 commit comments

Comments
 (0)