added page cloning to the editor...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-03-07 04:12:19 +04:00
parent 6b36c34c91
commit fc3ede4f5a
2 changed files with 34 additions and 7 deletions

View File

@ -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

View File

@ -232,6 +232,7 @@ function setupEditorToolbars(){
.appendTo(indicator)
$('<button class="button remove">&times;</button>')
.attr('title', 'Remove')
.appendTo(indicator)
.click(function(){
setTransitionDuration($('.magazine'), 0)
@ -242,14 +243,27 @@ function setupEditorToolbars(){
})
$('<button class="button shift">&gt;</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">&lt;</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(){