mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 11:10:08 +00:00
added page cloning to the editor...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6b36c34c91
commit
fc3ede4f5a
2
TODO.otl
2
TODO.otl
@ -4,7 +4,7 @@
|
||||
[_] change image
|
||||
[_] add page via template
|
||||
[_] load/save from JSON
|
||||
[_] basic instructions
|
||||
[_] basic instructions/docs...
|
||||
[_] 37% Version 1.0 checklist (migration to layout.html)
|
||||
[X] page scaling for full page view
|
||||
[X] top/bottom toolbars
|
||||
|
||||
31
editor.js
31
editor.js
@ -232,6 +232,7 @@ function setupEditorToolbars(){
|
||||
.appendTo(indicator)
|
||||
|
||||
$('<button class="button remove">×</button>')
|
||||
.attr('title', 'Remove')
|
||||
.appendTo(indicator)
|
||||
.click(function(){
|
||||
setTransitionDuration($('.magazine'), 0)
|
||||
@ -242,14 +243,27 @@ function setupEditorToolbars(){
|
||||
})
|
||||
|
||||
$('<button class="button shift">></button>')
|
||||
.attr('title', 'Move (w. Shift - Clone)')
|
||||
.appendTo(right_bar)
|
||||
.click(function(){
|
||||
// if shift is pressed duplicate current page...
|
||||
if(event.shiftKey){
|
||||
var n = getPageNumber()
|
||||
setTransitionDuration($('.magazine'), 0)
|
||||
$('.current.page')
|
||||
.clone(true, true)
|
||||
.removeClass('current')
|
||||
.insertAfter($('.current.page'))
|
||||
setCurrentPage(n)
|
||||
// simply move...
|
||||
} else {
|
||||
shiftPageRight()
|
||||
runMagazineTemplates()
|
||||
|
||||
}
|
||||
return false
|
||||
})
|
||||
$('<button class="button add">+</button>')
|
||||
.attr('title', 'New page')
|
||||
.appendTo(right_bar)
|
||||
.click(function(){
|
||||
|
||||
@ -257,14 +271,27 @@ function setupEditorToolbars(){
|
||||
})
|
||||
|
||||
$('<button class="button shift"><</button>')
|
||||
.attr('title', 'Move (w. Shift - Clone)')
|
||||
.appendTo(left_bar)
|
||||
.click(function(){
|
||||
// if shift is pressed duplicate current page...
|
||||
if(event.shiftKey){
|
||||
var n = getPageNumber()
|
||||
setTransitionDuration($('.magazine'), 0)
|
||||
$('.current.page')
|
||||
.clone(true, true)
|
||||
.removeClass('current')
|
||||
.insertBefore($('.current.page'))
|
||||
setCurrentPage(n+1)
|
||||
// simply move...
|
||||
} else {
|
||||
shiftPageLeft()
|
||||
runMagazineTemplates()
|
||||
|
||||
}
|
||||
return false
|
||||
})
|
||||
$('<button class="button add">+</button>')
|
||||
.attr('title', 'New page')
|
||||
.appendTo(left_bar)
|
||||
.click(function(){
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user