From: Dobrica Pavlinusic Date: Tue, 5 Mar 2013 15:32:22 +0000 (+0100) Subject: rewrite print to use ng-show and ng-class X-Git-Tag: 0.9~5 X-Git-Url: http://git.rot13.org/?p=angular-drzb;a=commitdiff_plain;h=516bac604787a539a318e8966f0fe9dea6e4c5e1 rewrite print to use ng-show and ng-class This allows much better copy/paste into libreoffice preserving line wraps along the way. When copy/pasting from Firefox, you won't get centered lines, but they do work from Chrome, go figure! --- diff --git a/app/js/controllers.js b/app/js/controllers.js index 092e07e..b98fb99 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -311,14 +311,17 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, ValidS $scope.pager.page = 1; } - $scope.print_hide = function(v) { - $log.info('print_hide', v); - if ( v ) { - angular.element('.print-hide').hide(); - angular.element('.print-add-center').addClass('print-center'); - } else { - angular.element('.print-hide').show(); - angular.element('.print-add-center').removeClass('print-center'); + $scope.print = { + layout: false, + center: '', + toggle: function(v) { + $log.info('print_hide', v); + $scope.print.layout = ! $scope.print.layout; + if ( v ) { + $scope.print.center = 'print-center'; + } else { + $scope.print.center = ''; + } } } } diff --git a/app/partials/list.html.ep b/app/partials/list.html.ep index d7c974b..586de49 100644 --- a/app/partials/list.html.ep +++ b/app/partials/list.html.ep @@ -60,7 +60,7 @@ All results on single page (can be slow!) diff --git a/app/registration/view.html.ep b/app/registration/view.html.ep index be6d902..70d2ee2 100644 --- a/app/registration/view.html.ep +++ b/app/registration/view.html.ep @@ -1,4 +1,4 @@ -
% if ( my $before = stash('before') ) { %= $before->() % } @@ -15,7 +15,7 @@
-

{{registration.user.firstname}} {{registration.user.surname}} {{registration.user.organization}}, @@ -32,15 +32,16 @@

-

{{registration.work.title}}

-

{{author.firstname}} - {{author.surname}}, - {{author.organization}} - <{{author.email}}> + {{author.surname}}, +
+ {{author.organization}} + <{{author.email}}>

{{registration.work.abstract}}