trying to fix the big problem with jQuery UI modals (if modals have the same z-index, it causes weird behaviours) (WIP)
This commit is contained in:
parent
ae16661286
commit
b751e3d990
@ -36,7 +36,7 @@ PATH
|
|||||||
haml (~> 3.1.4)
|
haml (~> 3.1.4)
|
||||||
highline (~> 1.6.2)
|
highline (~> 1.6.2)
|
||||||
httparty (~> 0.8.1)
|
httparty (~> 0.8.1)
|
||||||
jquery-rails (~> 1.0.16)
|
jquery-rails (~> 1.0.19)
|
||||||
kaminari (~> 0.13.0)
|
kaminari (~> 0.13.0)
|
||||||
locomotive-aloha-rails (~> 0.20.1.4)
|
locomotive-aloha-rails (~> 0.20.1.4)
|
||||||
locomotive-mongoid-tree (~> 0.6.2)
|
locomotive-mongoid-tree (~> 0.6.2)
|
||||||
|
@ -70,10 +70,10 @@ class Locomotive.Views.ContentEntries.FormView extends Locomotive.Views.Shared.F
|
|||||||
|
|
||||||
enable_has_many_fields: ->
|
enable_has_many_fields: ->
|
||||||
unless @model.isNew()
|
unless @model.isNew()
|
||||||
_.each @model.get('has_many_custom_fields'), (field) =>
|
_.each @model.get('has_many_custom_fields'), (field, index) =>
|
||||||
name = field[0]; inverse_of = field[1]
|
name = field[0]; inverse_of = field[1]
|
||||||
new_entry = new Locomotive.Models.ContentEntry(@options["#{name}_new_entry"])
|
new_entry = new Locomotive.Models.ContentEntry(@options["#{name}_new_entry"])
|
||||||
view = new Locomotive.Views.Shared.Fields.HasManyView model: @model, name: name, new_entry: new_entry, inverse_of: inverse_of
|
view = new Locomotive.Views.Shared.Fields.HasManyView model: @model, name: name, new_entry: new_entry, inverse_of: inverse_of, index: index
|
||||||
|
|
||||||
if view.ui_enabled()
|
if view.ui_enabled()
|
||||||
@_has_many_field_views.push(view)
|
@_has_many_field_views.push(view)
|
||||||
|
@ -23,10 +23,13 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
|
|||||||
@close()
|
@close()
|
||||||
|
|
||||||
create_dialog: ->
|
create_dialog: ->
|
||||||
|
# FIXME (Did): each modal window should have a different zIndex, otherwise there will be conflicts
|
||||||
|
zIndex = 998 + @options.index
|
||||||
|
|
||||||
@dialog = $(@el).dialog
|
@dialog = $(@el).dialog
|
||||||
autoOpen: false
|
autoOpen: false
|
||||||
modal: true
|
modal: true
|
||||||
zIndex: 998
|
zIndex: zIndex
|
||||||
width: 770,
|
width: 770,
|
||||||
create: (event, ui) =>
|
create: (event, ui) =>
|
||||||
$('.ui-widget-overlay').bind 'click', => @close()
|
$('.ui-widget-overlay').bind 'click', => @close()
|
||||||
@ -71,6 +74,9 @@ class Locomotive.Views.ContentEntries.PopupFormView extends Locomotive.Views.Con
|
|||||||
else
|
else
|
||||||
@refresh()
|
@refresh()
|
||||||
|
|
||||||
|
slugify_label_field: ->
|
||||||
|
# disabled in a popup form
|
||||||
|
|
||||||
enable_has_many_fields: ->
|
enable_has_many_fields: ->
|
||||||
# disabled in a popup form
|
# disabled in a popup form
|
||||||
|
|
||||||
|
@ -30,8 +30,9 @@ class Locomotive.Views.Shared.AssetPickerView extends Backbone.View
|
|||||||
|
|
||||||
create_dialog: ->
|
create_dialog: ->
|
||||||
@dialog = $(@el).dialog
|
@dialog = $(@el).dialog
|
||||||
|
autoOpen: false
|
||||||
modal: true
|
modal: true
|
||||||
zIndex: 998
|
zIndex: 996
|
||||||
width: 650,
|
width: 650,
|
||||||
create: (event, ui) =>
|
create: (event, ui) =>
|
||||||
$('.ui-widget-overlay').bind 'click', => @close()
|
$('.ui-widget-overlay').bind 'click', => @close()
|
||||||
|
@ -70,6 +70,7 @@ class Locomotive.Views.Shared.Fields.HasManyView extends Backbone.View
|
|||||||
el: $("##{@options.name}-template-entry")
|
el: $("##{@options.name}-template-entry")
|
||||||
parent_view: @
|
parent_view: @
|
||||||
model: @options.new_entry.clone() # by default, it does not matter
|
model: @options.new_entry.clone() # by default, it does not matter
|
||||||
|
index: @options.index
|
||||||
|
|
||||||
@target_entry_view.render()
|
@target_entry_view.render()
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
.ui-dialog-content {
|
.ui-dialog-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 999;
|
z-index: 1040;
|
||||||
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ module Locomotive
|
|||||||
class PagesController < BaseController
|
class PagesController < BaseController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@pages = current_site.pages.order([:depth, :asc], [:position, :asc])
|
@pages = current_site.pages.order_by([[:depth, :asc], [:position, :asc]])
|
||||||
respond_with(@pages)
|
respond_with(@pages)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
= link_to t('locomotive.buttons.close'), '#', :id => 'close-link'
|
= link_to t('locomotive.buttons.close'), '#', :id => 'close-link'
|
||||||
|
|
||||||
.button-wrapper.upload
|
.button-wrapper.upload
|
||||||
= form_tag theme_assets_url(:json), :class => 'quick-upload' do
|
= form_tag content_assets_url(:json), :class => 'quick-upload' do
|
||||||
= file_field_tag 'theme_asset[source]', :multiple => 'multiple'
|
= file_field_tag 'content_asset[source]', :multiple => 'multiple'
|
||||||
= link_to t('locomotive.theme_assets.image_picker.upload'), theme_assets_url(:json), :class => 'new', :id => 'upload-link'
|
= link_to t('locomotive.content_assets.image_picker.upload'), content_assets_url(:json), :class => 'new', :id => 'upload-link'
|
||||||
|
|
||||||
%script{ :type => 'text/html', :id => 'content_asset' }
|
%script{ :type => 'text/html', :id => 'content_asset' }
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@ Gem::Specification.new do |s|
|
|||||||
s.add_dependency 'kaminari', '~> 0.13.0'
|
s.add_dependency 'kaminari', '~> 0.13.0'
|
||||||
|
|
||||||
s.add_dependency 'haml', '~> 3.1.4'
|
s.add_dependency 'haml', '~> 3.1.4'
|
||||||
s.add_dependency 'jquery-rails', '~> 1.0.16'
|
# s.add_dependency 'jquery-rails', '~> 2.0.0' #'~> 1.0.16'
|
||||||
|
s.add_dependency 'jquery-rails', '~> 1.0.19'
|
||||||
s.add_dependency 'rails-backbone', '~> 0.6.1'
|
s.add_dependency 'rails-backbone', '~> 0.6.1'
|
||||||
s.add_dependency 'codemirror-rails', '~> 2.21'
|
s.add_dependency 'codemirror-rails', '~> 2.21'
|
||||||
s.add_dependency 'locomotive-tinymce-rails', '~> 3.4.7.2'
|
s.add_dependency 'locomotive-tinymce-rails', '~> 3.4.7.2'
|
||||||
|
Loading…
Reference in New Issue
Block a user