Commit 18b99fd31eb720384b213448e31c7ed06fd8cff2

Authored by Victor Costa
1 parent b7f58749

Enable block edition when toggle design mode

src/app/layout/blocks/block.component.ts
... ... @@ -4,13 +4,14 @@ import { BlockService } from '../../../lib/ng-noosfero-api/http/block.service';
4 4 import { NotificationService } from '../../shared/services/notification.service';
5 5 import { AuthService, SessionService, AuthEvents } from "../../login";
6 6 import { TranslatorService } from "../../shared/services/translator.service";
  7 +import { DesignModeService } from "../../admin/layout-edit/designMode.service";
7 8  
8 9 @Component({
9 10 selector: 'noosfero-block',
10 11 templateUrl: 'app/layout/blocks/block.html',
11 12 directives: [BlockEditionComponent]
12 13 })
13   -@Inject("$uibModal", "$scope", "$state", "$rootScope", BlockService, NotificationService, AuthService, SessionService, TranslatorService)
  14 +@Inject("$uibModal", "$scope", "$state", "$rootScope", BlockService, NotificationService, AuthService, SessionService, TranslatorService, DesignModeService)
14 15 export class BlockComponent {
15 16  
16 17 @Input() block: noosfero.Block;
... ... @@ -31,7 +32,8 @@ export class BlockComponent {
31 32 private notificationService: NotificationService,
32 33 private authService: AuthService,
33 34 private session: SessionService,
34   - private translatorService: TranslatorService) {
  35 + private translatorService: TranslatorService,
  36 + private designModeService: DesignModeService) {
35 37  
36 38 this.currentUser = this.session.currentUser();
37 39 this.authService.subscribe(AuthEvents[AuthEvents.loginSuccess], () => {
... ... @@ -45,6 +47,10 @@ export class BlockComponent {
45 47 this.$rootScope.$on("$stateChangeSuccess", (event: ng.IAngularEvent, toState: ng.ui.IState) => {
46 48 this.verifyHomepage();
47 49 });
  50 + this.designModeService.onToggle.subscribe((designModeOn: boolean) => {
  51 + this.editionMode = designModeOn;
  52 + this.$scope.$apply();
  53 + });
48 54 }
49 55  
50 56 ngOnInit() {
... ...
src/app/layout/scss/_layout.scss
... ... @@ -36,14 +36,6 @@
36 36 }
37 37 }
38 38  
39   -
40   -body.noosfero-design-on {
41   -
42   - div.content-wrapper {
43   - opacity: 0.5;
44   - }
45   -}
46   -
47 39 ul.nav > li.toggler-container {
48 40 position: relative;
49 41 padding-top: 12px;
... ... @@ -55,4 +47,4 @@ ul.nav > li.toggler-container {
55 47 margin-left: 0px;
56 48 margin-right: 0px;
57 49 background-color: #edecec;
58   -}
59 50 \ No newline at end of file
  51 +}
... ...