-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cloudinary-library
- Loading branch information
Showing
33 changed files
with
1,325 additions
and
620 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/app/panel/components/form/interfaces/form-field-hotspot.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {FormField} from './form-field'; | ||
|
||
export interface FormFieldHotspot extends FormField { | ||
fields: FormField[]; | ||
saveEndpoint?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/app/panel/components/form/types/hotspot/hotspot.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> | ||
<div class="form-group"> | ||
<div class="hotSpot-wrapper"> | ||
<div class="header"> | ||
Hotspot | ||
</div> | ||
|
||
<div class="img-wrapper" #imageWrapper | ||
(dragover)="onDragOver($event)" | ||
(drop)="onDrop($event)" | ||
> | ||
<img [src]="getControl().value.image" #image (click)="add($event)"> | ||
<div *ngFor="let hotSpot of getFormArray().controls; let i = index" | ||
class="hotSpot" | ||
[draggable]="true" | ||
[id]="'hotSpot_' + i" | ||
(dragstart)="onDragStart($event, i)" | ||
(drag)="onDrag($event, i)" | ||
(dragend)="onDragEnd($event, i)" | ||
[style.top]="hotSpot.value.y + 'px'" | ||
[style.left]="hotSpot.value.x + 'px'" | ||
><i class="fa fa-arrows"></i> | ||
<div class="edit" (click)="onEdit($event, i)" | ||
data-toggle="modal" data-target="#myModal"> | ||
<i class="fa fa-pencil"></i> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div id="myModal" class="modal fade" role="dialog" *ngIf="activeHotSpot != null"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal">×</button> | ||
<h4 class="modal-title">Hotspot</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<div *ngFor="let controlField of field.fields" class="row"> | ||
<app-form-type-switcher [form]="getActiveForm()" | ||
[isSubField]="true" | ||
[field]="controlField" | ||
[isEdit]="isEdit"> | ||
</app-form-type-switcher> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal" (click)="onClose($event)">Close</button> | ||
<button type="button" class="btn btn-danger" data-dismiss="modal" (click)="onDelete($event)">Delete</button> | ||
<button type="button" class="btn btn-primary" data-dismiss="modal" (click)="onSave($event)">Save</button> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
src/app/panel/components/form/types/hotspot/hotspot.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@import '../../../../../../assets/sass/partials/imports'; | ||
|
||
app-hotspot { | ||
.hotSpot-wrapper { | ||
> .header { | ||
margin-bottom: 10px; | ||
font-size: 13px; | ||
color: $default; | ||
} | ||
.img-wrapper { | ||
max-height: 800px; | ||
overflow: scroll; | ||
position: relative; | ||
> img { | ||
} | ||
> .hotSpot { | ||
position: absolute; | ||
background: $sidebarDark; | ||
padding: 6px 9px; | ||
font-size: 16px; | ||
border-radius: 50%; | ||
color: #fff; | ||
cursor: move; | ||
|
||
> div.edit { | ||
position: absolute; | ||
background: $warning; | ||
color: #ffffff; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
padding: 2px 3px 0; | ||
font-size: 12px; | ||
top: -5px; | ||
right: -5px; | ||
} | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/panel/components/form/types/hotspot/hotspot.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { HotspotComponent } from './hotspot.component'; | ||
|
||
describe('HotspotComponent', () => { | ||
let component: HotspotComponent; | ||
let fixture: ComponentFixture<HotspotComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ HotspotComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HotspotComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.