End of day commit, styling and dropdown logic
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
Qsupplier.App.DropdownLink = Ember.Component.extend
|
||||||
|
templateName: 'dropdown_link_view'
|
||||||
|
active: false
|
||||||
|
classNames: ['dropdown-container']
|
||||||
|
classNameBindings: ['active']
|
||||||
|
didInsertElement: ->
|
||||||
|
@$('.dropdown-trigger').click (e)=>
|
||||||
|
e.preventDefault()
|
||||||
|
@set 'active', !@get('active')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
Qsupplier.App.SectionController = Ember.ObjectController.extend
|
Qsupplier.App.SectionController = Ember.ObjectController.extend
|
||||||
needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
||||||
editmode: false
|
editmode: false
|
||||||
|
actions:
|
||||||
|
markListAsHelped: (list) -> list.is_helped() if list
|
||||||
|
closeList: (list)-> list.close() if list
|
||||||
makeEditable: -> @set('editmode', true)
|
makeEditable: -> @set('editmode', true)
|
||||||
finishEditable: ->
|
finishEditable: ->
|
||||||
@set('editmode', false)
|
@set('editmode', false)
|
||||||
@get('model').save()
|
@get('model').save()
|
||||||
addTables: ->
|
addTables: ->
|
||||||
|
debugger
|
||||||
$('#add-tables-modal').modal()
|
$('#add-tables-modal').modal()
|
||||||
arrangeTables: ->
|
arrangeTables: ->
|
||||||
$('#arrange-tables-modal').modal()
|
$('#arrange-tables-modal').modal()
|
||||||
actions:
|
|
||||||
markListAsHelped: (list) -> list.is_helped() if list
|
|
||||||
closeList: (list)-> list.close() if list
|
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
a.dropdown-trigger.button.tiny.dropdown href="#"
|
||||||
|
span.dropdown-trigger-text= view.title
|
||||||
|
/span.dropdown-trigger-icon
|
||||||
|
.dropdown-list-container
|
||||||
|
= yield
|
||||||
@@ -12,11 +12,12 @@
|
|||||||
each texture in textures
|
each texture in textures
|
||||||
li
|
li
|
||||||
a{ action setTexture texture } {{texture}}
|
a{ action setTexture texture } {{texture}}
|
||||||
a.tiny.button.dropdown href="#" data-dropdown="section-action-list" Action
|
/a.tiny.button.dropdown.section-actions-menu-header href="#" data-dropdown="section-action-list" Action
|
||||||
/button.btn.dropdown-toggle data-toggle="dropdown"
|
/button.btn.dropdown-toggle data-toggle="dropdown"
|
||||||
span Action
|
span Action
|
||||||
span.caret
|
span.caret
|
||||||
ul#section-action-list.f-dropdown data-dropdown-content=true
|
Qsupplier.App.DropdownLink title="Action"
|
||||||
|
ul
|
||||||
li
|
li
|
||||||
a{action addTables} {{t 'section.add_tables.button_label'}}
|
a{action addTables} {{t 'section.add_tables.button_label'}}
|
||||||
li
|
li
|
||||||
@@ -25,10 +26,10 @@
|
|||||||
a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}" {{t 'tables.qr_codes.link'}}
|
a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}" {{t 'tables.qr_codes.link'}}
|
||||||
li
|
li
|
||||||
a href="{{route 'suppliers_section_path' id}}" data-method="delete" data-confirm="{{t 'helpers.links.are_you_sure' bare=true}}" {{t 'helpers.links.destroy'}}
|
a href="{{route 'suppliers_section_path' id}}" data-method="delete" data-confirm="{{t 'helpers.links.are_you_sure' bare=true}}" {{t 'helpers.links.destroy'}}
|
||||||
view Ember.TextField valueBinding="title" class="section-edit-title-field"
|
Ember.TextField valueBinding="title" class="section-edit-title-field"
|
||||||
view Ember.TextField valueBinding="width" class="dimension section-edit-width-field"
|
Qsupplier.App.NumberField valueBinding="width" class="dimension section-edit-width-field"
|
||||||
span x
|
span.fa.fa-lg.fa-times
|
||||||
view Ember.TextField valueBinding="height" class="dimension section-edit-height-field"
|
Qsupplier.App.NumberField valueBinding="height" class="dimension section-edit-height-field"
|
||||||
a.section-normal-mode-button{ action finishEditable }: span
|
a.section-normal-mode-button{ action finishEditable }: span
|
||||||
else
|
else
|
||||||
a.section-edit-mode-button{ action makeEditable }: span
|
a.section-edit-mode-button{ action makeEditable }: span
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Qsupplier.App.NumberField = Ember.TextField.extend
|
||||||
|
type: 'number'
|
||||||
|
attributeBindings: ['min', 'max', 'step']
|
||||||
@@ -45,7 +45,7 @@ Qsupplier.App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
|
|||||||
#click: ->
|
#click: ->
|
||||||
#@$('.table-actions').show()
|
#@$('.table-actions').show()
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
@$el = @$(@get('element'))
|
@$el = @$()
|
||||||
#@$('.table-actions').hide()
|
#@$('.table-actions').hide()
|
||||||
#title = @$('.table-actions .title').clone()
|
#title = @$('.table-actions .title').clone()
|
||||||
content = @$('.table-actions')
|
content = @$('.table-actions')
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#Qsupplier.App.SectionView = Ember.View.extend {}
|
||||||
|
#initFoundation: (->
|
||||||
|
#debugger
|
||||||
|
#@$().foundation()
|
||||||
|
#).on('didInsertElement')
|
||||||
|
#didInsertElement: ->
|
||||||
|
#@$().foundation()
|
||||||
|
#debugger
|
||||||
|
#true
|
||||||
|
#$(document).on 'load', '[data-dropdown]', (a,b,c)->
|
||||||
|
#debugger
|
||||||
|
#true
|
||||||
|
#$(document).on 'change', '[data-dropdown]', (a,b,c)->
|
||||||
|
#debugger
|
||||||
|
#true
|
||||||
|
#$(document).on 'ready', '[data-dropdown]', (a,b,c)->
|
||||||
|
#debugger
|
||||||
|
#true
|
||||||
|
#$(document).on 'click', '[data-dropdown]', (a,b,c)->
|
||||||
|
#debugger
|
||||||
|
#true
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require jquery.ui.sortable
|
//= require jquery.ui.sortable
|
||||||
//= require vendor/modernizr
|
//= require vendor/modernizr
|
||||||
//= require foundation
|
// require foundation FOUNDATION 5 JAVASCRIPT IMPLEMENTATIONS AND EMBER ARE NOT COMPATIBLE, FOUNDATION IS TOO SIMPLISTIC AT THE MOMENT AND DESTROYS DOM EVENTS
|
||||||
//= require js-routes
|
//= require js-routes
|
||||||
//= require translations
|
//= require translations
|
||||||
//= require qwaiter
|
//= require qwaiter
|
||||||
@@ -20,8 +20,6 @@ var Qstorage = localStorage;
|
|||||||
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
||||||
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
||||||
|
|
||||||
$(document).foundation();
|
|
||||||
|
|
||||||
String.prototype.capitalize = function() {
|
String.prototype.capitalize = function() {
|
||||||
return this.charAt(0).toUpperCase() + this.slice(1);
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
font-size: 24px
|
font-size: 24px
|
||||||
padding: 4px 0px
|
padding: 4px 0px
|
||||||
.section-manage-tables
|
.section-manage-tables
|
||||||
margin: -32px 6px 4px 6px
|
margin: -26px 6px 4px 6px
|
||||||
min-width: 470px
|
min-width: 470px
|
||||||
text-align: right
|
text-align: right
|
||||||
.section-edit-title-field
|
.section-edit-title-field
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
width: 120px
|
width: 120px
|
||||||
.section-edit-width-field
|
.section-edit-width-field
|
||||||
display: inline-block
|
display: inline-block
|
||||||
width: 40px
|
width: 52px
|
||||||
.section-edit-height-field
|
.section-edit-height-field
|
||||||
display: inline-block
|
display: inline-block
|
||||||
width: 40px
|
width: 52px
|
||||||
#section-action-list
|
#section-action-list
|
||||||
text-align: left
|
text-align: left
|
||||||
.section-tables-container
|
.section-tables-container
|
||||||
@@ -28,7 +28,9 @@
|
|||||||
height: 48px
|
height: 48px
|
||||||
width: 83px
|
width: 83px
|
||||||
background-repeat: no-repeat
|
background-repeat: no-repeat
|
||||||
|
box-shadow: 5px 5px 5px #888888
|
||||||
color: black
|
color: black
|
||||||
|
border-radius: 3px
|
||||||
a
|
a
|
||||||
color: black
|
color: black
|
||||||
//background-image: image-url('icons/section-table.png')
|
//background-image: image-url('icons/section-table.png')
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
.dropdown-container
|
||||||
|
position: relative
|
||||||
|
display: inline-block
|
||||||
|
.button.dropdown-trigger
|
||||||
|
padding-top: 4px
|
||||||
|
padding-bottom: 4px
|
||||||
|
margin-bottom: 0
|
||||||
|
.dropdown-trigger-icon
|
||||||
|
@extend .fa
|
||||||
|
@extend .fa-lg
|
||||||
|
@extend .fa-caret-left
|
||||||
|
margin-right: 6px
|
||||||
|
|
||||||
|
.dropdown-list-container
|
||||||
|
display: none
|
||||||
|
text-align: left
|
||||||
|
background-color: white
|
||||||
|
position: absolute
|
||||||
|
right: 0
|
||||||
|
margin: 0
|
||||||
|
min-width: 160px
|
||||||
|
z-index: 542
|
||||||
|
margin-top: 7px
|
||||||
|
border-radius: 4px
|
||||||
|
|
||||||
|
&:after
|
||||||
|
border: solid transparent
|
||||||
|
content: " "
|
||||||
|
height: 0
|
||||||
|
width: 0
|
||||||
|
position: absolute
|
||||||
|
pointer-events: none
|
||||||
|
border-width: 6px
|
||||||
|
border-bottom-color: white
|
||||||
|
bottom: 100%
|
||||||
|
right: 30px
|
||||||
|
|
||||||
|
|
||||||
|
ul
|
||||||
|
list-style: none
|
||||||
|
//&:hover
|
||||||
|
//.dropdown-list-container
|
||||||
|
//display: block
|
||||||
|
&.active
|
||||||
|
.dropdown-list-container
|
||||||
|
display: block
|
||||||
|
.button.dropdown-trigger
|
||||||
|
.dropdown-trigger-icon
|
||||||
|
@extend .fa-caret-down
|
||||||
@@ -8,3 +8,15 @@
|
|||||||
@extend .fa
|
@extend .fa
|
||||||
@extend .fa-lg
|
@extend .fa-lg
|
||||||
@extend .fa-save
|
@extend .fa-save
|
||||||
|
.section-actions-menu-header
|
||||||
|
padding-top: 4px
|
||||||
|
padding-bottom: 4px
|
||||||
|
.section-manage-tables
|
||||||
|
.dropdown-container
|
||||||
|
margin-right: 10px
|
||||||
|
input
|
||||||
|
height: auto
|
||||||
|
padding-top: 4px
|
||||||
|
padding-bottom: 4px
|
||||||
|
&.section-edit-title-field
|
||||||
|
margin-right: 10px
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $side-spacing: 0px
|
|||||||
.draggable
|
.draggable
|
||||||
cursor: move !important
|
cursor: move !important
|
||||||
input.dimension
|
input.dimension
|
||||||
width: 40px
|
width: 52px
|
||||||
.location_picker_map
|
.location_picker_map
|
||||||
width: 600px
|
width: 600px
|
||||||
height: 500px
|
height: 500px
|
||||||
|
|||||||
@@ -17,3 +17,4 @@
|
|||||||
@import ./qtables
|
@import ./qtables
|
||||||
@import ./section_tab_headers
|
@import ./section_tab_headers
|
||||||
@import ./qlists
|
@import ./qlists
|
||||||
|
@import ./ember_dropdown
|
||||||
|
|||||||
Reference in New Issue
Block a user