fixed title and some other minor stuff...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-04-19 23:24:40 +04:00
parent 7b4e7c20e6
commit d8463700d0
2 changed files with 11 additions and 3 deletions

View File

@ -206,11 +206,14 @@ function str2ab(str) {
function loadMagazineDOM(data){
var data = $(data)
// get the .magazine element...
data = data.hasClass('magazine') ? data.children() : data.find('.magazine').children()
data = data.hasClass('magazine') ? data : data.find('.magazine')
var title = data.attr('name')
var mag = $('.magazine')
mag.children().remove()
mag.append(data)
mag
.append(data.children())
.attr('name', title)
runMagazineTemplates()
togglePageView(togglePageView('?'))

View File

@ -1625,6 +1625,12 @@ function createCoverPage(data){
// NOTE: for these to be self-aplicable they must only replace the content
// of the matched elements and not touch the element itself.
var MagazineTemplates = {
/*
'.magazine[name]': function(elem){
$('.magazine-title-text').text($(elem).attr('name'))
},
*/
'.image-fit': function(elem){
var w = $('.content').width()
var h = $('.content').height()
@ -1636,7 +1642,6 @@ var MagazineTemplates = {
})
},
// set dpi value...
'.dpi': function(elem){
elem.text(getDPI())