pageflow 12.1.0 → 12.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +90 -171
- data/MIT-LICENSE +1 -1
- data/README.md +22 -2
- data/admins/pageflow/entry.rb +3 -1
- data/admins/pageflow/user.rb +9 -3
- data/app/assets/javascripts/pageflow/browser/agent.js +20 -9
- data/app/assets/javascripts/pageflow/browser/autoplay_support.js +3 -2
- data/app/assets/javascripts/pageflow/dist/react.js +6000 -4941
- data/app/assets/javascripts/pageflow/editor/initializers/setup_collections.js +0 -1
- data/app/assets/javascripts/pageflow/editor/views/page_preview_view.js +0 -5
- data/app/assets/javascripts/pageflow/links.js +0 -7
- data/app/assets/javascripts/pageflow/ready.js +2 -0
- data/app/assets/javascripts/pageflow/slideshow.js +1 -0
- data/app/assets/javascripts/pageflow/slideshow/hide_text_on_swipe.js +10 -5
- data/app/assets/javascripts/pageflow/slideshow/page_split_layout.js +74 -0
- data/app/assets/javascripts/pageflow/slideshow/page_widget.js +25 -1
- data/app/assets/javascripts/pageflow/slideshow/swipe_gesture.js +5 -3
- data/app/assets/javascripts/pageflow/ui.js +1 -0
- data/app/assets/javascripts/pageflow/ui/templates/inputs/text_area_input.jst.ejs +1 -1
- data/app/assets/javascripts/pageflow/ui/templates/inputs/text_input.jst.ejs +1 -1
- data/app/assets/javascripts/pageflow/ui/views/inputs/color_input_view.js +105 -0
- data/app/assets/javascripts/pageflow/visited.js +62 -34
- data/app/assets/javascripts/pageflow/widgets/overview.js +18 -5
- data/app/assets/stylesheets/pageflow/base.scss +0 -1
- data/app/assets/stylesheets/pageflow/entries.scss +11 -3
- data/app/assets/stylesheets/pageflow/mixins.scss +1 -0
- data/app/assets/stylesheets/pageflow/mixins/layout_direction.scss +72 -0
- data/app/assets/stylesheets/pageflow/mixins/shadow.scss +20 -0
- data/app/assets/stylesheets/pageflow/navigation_bar.scss +8 -2
- data/app/assets/stylesheets/pageflow/navigation_mobile.scss +1 -2
- data/app/assets/stylesheets/pageflow/overview.scss +10 -11
- data/app/assets/stylesheets/pageflow/page.scss +3 -37
- data/app/assets/stylesheets/pageflow/page_transitions/fade.scss +7 -3
- data/app/assets/stylesheets/pageflow/page_transitions/fade_to_black.scss +1 -10
- data/app/assets/stylesheets/pageflow/slideshow.scss +1 -2
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +5 -0
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -0
- data/app/assets/stylesheets/pageflow/themes/default/loading_spinner.scss +9 -3
- data/app/assets/stylesheets/pageflow/themes/default/logo.scss +9 -3
- data/app/assets/stylesheets/pageflow/themes/default/logo/alignment.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +52 -5
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +6 -3
- data/app/assets/stylesheets/pageflow/{multimedia_alert.scss → themes/default/multimedia_alert.scss} +32 -11
- data/app/assets/stylesheets/pageflow/themes/default/overview.scss +7 -3
- data/app/assets/stylesheets/pageflow/themes/default/overview/icons/icon_font.scss +20 -4
- data/app/assets/stylesheets/pageflow/themes/default/page.scss +20 -53
- data/app/assets/stylesheets/pageflow/themes/default/page/line_lengths.scss +3 -8
- data/app/assets/stylesheets/pageflow/themes/default/page/paddings.scss +72 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/scroller.scss +3 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/shadow.scss +27 -0
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -0
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/container.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui.scss +2 -0
- data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +25 -0
- data/app/controllers/pageflow/application_controller.rb +17 -3
- data/app/helpers/pageflow/overview_helper.rb +11 -0
- data/app/helpers/pageflow/text_direction_helper.rb +7 -0
- data/app/policies/pageflow/user_policy.rb +20 -0
- data/app/views/admin/accounts/_account_details.html.arb +5 -3
- data/app/views/admin/accounts/_theming_details.html.arb +5 -3
- data/app/views/admin/entries/_attributes_table.html.arb +3 -1
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +88 -0
- data/app/views/layouts/pageflow/application.html.erb +1 -1
- data/app/views/pageflow/entries/edit.html.erb +1 -1
- data/app/views/pageflow/entries/overview/_page.html.erb +3 -1
- data/app/views/pageflow/entries/show.html.erb +2 -1
- data/config/initializers/admin_attributes_table_rows.rb +3 -0
- data/config/locales/de.yml +1 -1
- data/lib/pageflow.rb +4 -2
- data/lib/pageflow/ability_mixin.rb +8 -0
- data/lib/pageflow/admin/attributes_table_rows.rb +47 -0
- data/lib/pageflow/configuration.rb +27 -3
- data/lib/pageflow/engine.rb +1 -0
- data/lib/pageflow/news_item_api.rb +18 -0
- data/lib/pageflow/version.rb +1 -1
- data/spec/factories/accounts.rb +7 -2
- data/spec/factories/entries.rb +7 -2
- data/vendor/assets/javascripts/iscroll.js +49 -34
- metadata +53 -12
@@ -1,4 +1,5 @@
|
|
1
1
|
<% @page_title = pretty_entry_title(@entry) %>
|
2
|
+
<% @page_text_direction = text_direction(@entry.locale) %>
|
2
3
|
|
3
4
|
<% content_for(:head) do %>
|
4
5
|
<%= cache [@entry, :head, @entry.share_target] do %>
|
@@ -25,7 +26,7 @@
|
|
25
26
|
pageflow.seed = <%= entry_json_seed(@entry) %>;
|
26
27
|
|
27
28
|
pageflow.manualStart.enabled = <%= @entry.manual_start ? 'true' : 'false' %>;
|
28
|
-
pageflow.
|
29
|
+
pageflow.Visited.enabled = <%= @entry.emphasize_new_pages ? 'true' : 'false' %>;
|
29
30
|
pageflow.pages = pageflow.seed.pages;
|
30
31
|
pageflow.audioFiles = <%= entry_audio_files_json_seed(@entry) %>;
|
31
32
|
pageflow.entryId = <%= @entry.id %>;
|
data/config/locales/de.yml
CHANGED
data/lib/pageflow.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'pageflow/engine'
|
2
|
+
require 'pageflow/global_config_api'
|
3
|
+
require 'pageflow/news_item_api'
|
3
4
|
|
4
5
|
module Pageflow
|
5
6
|
extend GlobalConfigApi
|
7
|
+
extend NewsItemApi
|
6
8
|
|
7
9
|
def self.routes(router)
|
8
10
|
router.instance_eval do
|
@@ -235,6 +235,14 @@ module Pageflow
|
|
235
235
|
UserPolicy::Scope.new(user, ::User).resolve do |managed_user|
|
236
236
|
UserPolicy.new(user, managed_user).redirect_to_user?
|
237
237
|
end
|
238
|
+
|
239
|
+
can :suspend, ::User do |managed_user|
|
240
|
+
UserPolicy.new(user, managed_user).suspend?
|
241
|
+
end
|
242
|
+
|
243
|
+
can :destroy, ::User do |managed_user|
|
244
|
+
UserPolicy.new(user, managed_user).destroy?
|
245
|
+
end
|
238
246
|
end
|
239
247
|
|
240
248
|
can :delete_own_user, ::User do |user_to_delete|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# A registry of additional rows to display in attribute tables on
|
3
|
+
# admin pages.
|
4
|
+
#
|
5
|
+
# @since 12.2
|
6
|
+
module Admin
|
7
|
+
class AttributesTableRows
|
8
|
+
# @api private
|
9
|
+
def initialize
|
10
|
+
@rows = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
# Insert an additional row into an attribute table.
|
14
|
+
#
|
15
|
+
# @param resource_name [Symbol] Either :entry, :account or :theming.
|
16
|
+
#
|
17
|
+
# @param name [Symbol] Name of the attribute to display.
|
18
|
+
#
|
19
|
+
# @param options [Hash] Supports same options as
|
20
|
+
# ActiveAdmin::Views::AttributesTable#row, in addition to:
|
21
|
+
#
|
22
|
+
# @option options [Symbol] :before Insert row before row with
|
23
|
+
# given name. Append to table if not found.
|
24
|
+
#
|
25
|
+
# @option options [Symbol] :after Insert row after row with
|
26
|
+
# given name. Append to table if not found.
|
27
|
+
#
|
28
|
+
# @yieldparam resource [ActiveRecord::Base] A block which is
|
29
|
+
# evaluated in the context of the Arbre template to render the
|
30
|
+
# contents of the cell.
|
31
|
+
def register(resource_name, name, options = {}, &block)
|
32
|
+
@rows[resource_name] ||= []
|
33
|
+
@rows[resource_name] << {
|
34
|
+
name: name,
|
35
|
+
block: block,
|
36
|
+
options: options.except(:before, :after),
|
37
|
+
**options.slice(:before, :after)
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# @api private
|
42
|
+
def for(resource_name)
|
43
|
+
@rows.fetch(resource_name, [])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -192,14 +192,30 @@ module Pageflow
|
|
192
192
|
#
|
193
193
|
# @example
|
194
194
|
#
|
195
|
-
# config.admin_form_inputs.register(:entry) do
|
196
|
-
# form.input(:custom_field)
|
197
|
-
# end
|
195
|
+
# config.admin_form_inputs.register(:entry, :custom_field) do
|
198
196
|
#
|
199
197
|
# @since 0.9
|
200
198
|
# @return [Admin::FormInputs]
|
201
199
|
attr_reader :admin_form_inputs
|
202
200
|
|
201
|
+
# Insert additional rows into admin attributes tables.
|
202
|
+
#
|
203
|
+
# @example
|
204
|
+
#
|
205
|
+
# config.admin_attributes_table_rows.register(:entry, :custom)
|
206
|
+
# config.admin_attributes_table_rows.register(:entry, :my_attribute, after: :title)
|
207
|
+
# config.admin_attributes_table_rows.register(:entry, :some_attribute, before: :updated_at)
|
208
|
+
#
|
209
|
+
# @example Custom content
|
210
|
+
#
|
211
|
+
# config.admin_attributes_table_rows.register(:entry, :custom) do |entry|
|
212
|
+
# span(entry.custom_attribute)
|
213
|
+
# end
|
214
|
+
#
|
215
|
+
# @since 12.2
|
216
|
+
# @return [Admin::AttributesTableRows]
|
217
|
+
attr_reader :admin_attributes_table_rows
|
218
|
+
|
203
219
|
# Array of locales which can be chosen as interface language by a
|
204
220
|
# user. Defaults to `[:en, :de]`.
|
205
221
|
# @since 0.7
|
@@ -271,6 +287,12 @@ module Pageflow
|
|
271
287
|
# @since 12.1
|
272
288
|
attr_accessor :edit_lock_polling_interval
|
273
289
|
|
290
|
+
# News collection to add items to. Can be used to integrate
|
291
|
+
# Pageflow with Krant (see https://github.com/codevise/krant).
|
292
|
+
# @return [#item]
|
293
|
+
# @since 12.2
|
294
|
+
attr_accessor :news
|
295
|
+
|
274
296
|
def initialize
|
275
297
|
@paperclip_filesystem_default_options = {validate_media_type: false}
|
276
298
|
@paperclip_s3_default_options = {validate_media_type: false}
|
@@ -300,6 +322,7 @@ module Pageflow
|
|
300
322
|
|
301
323
|
@admin_resource_tabs = Pageflow::Admin::Tabs.new
|
302
324
|
@admin_form_inputs = Pageflow::Admin::FormInputs.new
|
325
|
+
@admin_attributes_table_rows = Pageflow::Admin::AttributesTableRows.new
|
303
326
|
|
304
327
|
@available_locales = [:en, :de]
|
305
328
|
@available_public_locales = PublicI18n.available_locales
|
@@ -369,6 +392,7 @@ module Pageflow
|
|
369
392
|
delegate :widget_types, to: :config
|
370
393
|
delegate :help_entries, to: :config
|
371
394
|
delegate :admin_form_inputs, to: :config
|
395
|
+
delegate :admin_attributes_table_rows, to: :config
|
372
396
|
delegate :themes, to: :config
|
373
397
|
end
|
374
398
|
end
|
data/lib/pageflow/engine.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# Api for plugins to contribute news items for the news collection
|
3
|
+
# configured via `config.news`. Included in the Pageflow module to
|
4
|
+
# provide `news_item` class method.
|
5
|
+
module NewsItemApi
|
6
|
+
# Add a item to the news collection configured via
|
7
|
+
# `Configuration#news`. Intended to be used with Krant (see
|
8
|
+
# https://github.com/codevise/krant). See Krant's readme for
|
9
|
+
# details on the supported parameters.
|
10
|
+
#
|
11
|
+
# @since 12.2
|
12
|
+
def news_item(name, options)
|
13
|
+
after_global_configure do |config|
|
14
|
+
config.news.item(name, options) if config.news
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/pageflow/version.rb
CHANGED
data/spec/factories/accounts.rb
CHANGED
@@ -6,14 +6,14 @@ FactoryGirl.define do
|
|
6
6
|
account.default_theming ||= build(:theming, account: account)
|
7
7
|
end
|
8
8
|
|
9
|
-
# inline membership creation
|
10
|
-
|
11
9
|
transient do
|
12
10
|
with_member nil
|
13
11
|
with_previewer nil
|
14
12
|
with_editor nil
|
15
13
|
with_publisher nil
|
16
14
|
with_manager nil
|
15
|
+
|
16
|
+
with_feature nil
|
17
17
|
end
|
18
18
|
|
19
19
|
after(:create) do |account, evaluator|
|
@@ -38,5 +38,10 @@ FactoryGirl.define do
|
|
38
38
|
user: evaluator.with_manager,
|
39
39
|
role: :manager) if evaluator.with_manager
|
40
40
|
end
|
41
|
+
|
42
|
+
after(:build) do |entry, evaluator|
|
43
|
+
entry.features_configuration =
|
44
|
+
entry.features_configuration.merge(evaluator.with_feature => true)
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
data/spec/factories/entries.rb
CHANGED
@@ -13,13 +13,13 @@ module Pageflow
|
|
13
13
|
entry.theming ||= entry.account.default_theming
|
14
14
|
end
|
15
15
|
|
16
|
-
# inline membership creation
|
17
|
-
|
18
16
|
transient do
|
19
17
|
with_previewer nil
|
20
18
|
with_editor nil
|
21
19
|
with_publisher nil
|
22
20
|
with_manager nil
|
21
|
+
|
22
|
+
with_feature nil
|
23
23
|
end
|
24
24
|
|
25
25
|
after(:create) do |entry, evaluator|
|
@@ -41,6 +41,11 @@ module Pageflow
|
|
41
41
|
role: :manager) if evaluator.with_manager
|
42
42
|
end
|
43
43
|
|
44
|
+
after(:build) do |entry, evaluator|
|
45
|
+
entry.features_configuration =
|
46
|
+
entry.features_configuration.merge(evaluator.with_feature => true)
|
47
|
+
end
|
48
|
+
|
44
49
|
trait :published do
|
45
50
|
transient do
|
46
51
|
published_revision_attributes({})
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/*jshint trailing: false*/
|
2
2
|
/*! iScroll v5.0.4 ~ (c) 2008-2013 Matteo Spinelli ~ http://cubiq.org/license */
|
3
3
|
var IScroll = (function (window, document, Math) {
|
4
|
+
|
4
5
|
var rAF = window.requestAnimationFrame ||
|
5
6
|
window.webkitRequestAnimationFrame ||
|
6
7
|
window.mozRequestAnimationFrame ||
|
@@ -138,21 +139,13 @@ var utils = (function () {
|
|
138
139
|
e.className = e.className.replace(re, '');
|
139
140
|
};
|
140
141
|
|
141
|
-
me.
|
142
|
-
var
|
143
|
-
|
144
|
-
|
145
|
-
// jshint -W084
|
146
|
-
while (el = el.offsetParent) {
|
147
|
-
left -= el.offsetLeft;
|
148
|
-
top -= el.offsetTop;
|
149
|
-
}
|
150
|
-
// jshint +W084
|
142
|
+
me.isDirLtr = function (el) {
|
143
|
+
var styles = window.getComputedStyle(el);
|
144
|
+
return styles.direction == 'ltr';
|
145
|
+
};
|
151
146
|
|
152
|
-
|
153
|
-
|
154
|
-
top: top
|
155
|
-
};
|
147
|
+
me.offsetRight = function (e) {
|
148
|
+
return e.offsetParent ? e.offsetParent.offsetWidth - e.offsetLeft - e.offsetWidth : 0;
|
156
149
|
};
|
157
150
|
|
158
151
|
me.extend(me.eventType = {}, {
|
@@ -257,7 +250,7 @@ function IScroll (el, options) {
|
|
257
250
|
|
258
251
|
snapThreshold: 0.334,
|
259
252
|
|
260
|
-
// INSERT POINT: OPTIONS
|
253
|
+
// INSERT POINT: OPTIONS
|
261
254
|
|
262
255
|
startX: 0,
|
263
256
|
startY: 0,
|
@@ -312,11 +305,12 @@ function IScroll (el, options) {
|
|
312
305
|
|
313
306
|
// INSERT POINT: NORMALIZATION
|
314
307
|
|
315
|
-
// Some defaults
|
308
|
+
// Some defaults
|
316
309
|
this.x = 0;
|
317
310
|
this.y = 0;
|
318
311
|
this.directionX = 0;
|
319
312
|
this.directionY = 0;
|
313
|
+
this.dir = utils.isDirLtr(this.wrapper) ? 1 : -1;
|
320
314
|
this._events = {};
|
321
315
|
|
322
316
|
// INSERT POINT: DEFAULTS
|
@@ -430,7 +424,7 @@ IScroll.prototype = {
|
|
430
424
|
}
|
431
425
|
|
432
426
|
var point = e.touches ? e.touches[0] : e,
|
433
|
-
deltaX = this.hasHorizontalScroll ? point.pageX - this.pointX : 0,
|
427
|
+
deltaX = this.dir * (this.hasHorizontalScroll ? point.pageX - this.pointX : 0),
|
434
428
|
deltaY = this.hasVerticalScroll ? point.pageY - this.pointY : 0,
|
435
429
|
timestamp = utils.getTime(),
|
436
430
|
newX, newY,
|
@@ -687,7 +681,7 @@ IScroll.prototype = {
|
|
687
681
|
this.directionX = 0;
|
688
682
|
this.directionY = 0;
|
689
683
|
|
690
|
-
this.wrapperOffset =
|
684
|
+
this.wrapperOffset = this.offset(this.wrapper);
|
691
685
|
|
692
686
|
this._execEvent('refresh');
|
693
687
|
|
@@ -756,10 +750,10 @@ IScroll.prototype = {
|
|
756
750
|
return;
|
757
751
|
}
|
758
752
|
|
759
|
-
var pos =
|
753
|
+
var pos = this.offset(el);
|
760
754
|
|
761
|
-
pos.
|
762
|
-
pos.
|
755
|
+
pos.x -= this.wrapperOffset.x;
|
756
|
+
pos.y -= this.wrapperOffset.y;
|
763
757
|
|
764
758
|
// if offsetX/Y are true we center the element to the screen
|
765
759
|
if ( offsetX === true ) {
|
@@ -769,15 +763,15 @@ IScroll.prototype = {
|
|
769
763
|
offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);
|
770
764
|
}
|
771
765
|
|
772
|
-
pos.
|
773
|
-
pos.
|
766
|
+
pos.x -= offsetX || 0;
|
767
|
+
pos.y -= offsetY || 0;
|
774
768
|
|
775
|
-
pos.
|
776
|
-
pos.
|
769
|
+
pos.x = pos.x > 0 ? 0 : pos.x < this.maxScrollX ? this.maxScrollX : pos.x;
|
770
|
+
pos.y = pos.y > 0 ? 0 : pos.y < this.maxScrollY ? this.maxScrollY : pos.y;
|
777
771
|
|
778
|
-
time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(pos.
|
772
|
+
time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(pos.x)*2, Math.abs(pos.y)*2) : time;
|
779
773
|
|
780
|
-
this.scrollTo(pos.
|
774
|
+
this.scrollTo(pos.x, pos.y, time, easing);
|
781
775
|
},
|
782
776
|
|
783
777
|
_transitionTime: function (time) {
|
@@ -819,7 +813,7 @@ IScroll.prototype = {
|
|
819
813
|
|
820
814
|
/* REPLACE START: _translate */
|
821
815
|
|
822
|
-
this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
|
816
|
+
this.scrollerStyle[utils.style.transform] = 'translate(' + (this.dir * x) + 'px,' + y + 'px)' + this.translateZ;
|
823
817
|
|
824
818
|
/* REPLACE END: _translate */
|
825
819
|
|
@@ -878,13 +872,34 @@ IScroll.prototype = {
|
|
878
872
|
eventType(this.scroller, 'MSTransitionEnd', this);
|
879
873
|
},
|
880
874
|
|
875
|
+
offsetX: function (el) {
|
876
|
+
return this.dir > 0 ? el.offsetLeft : utils.offsetRight(el);
|
877
|
+
},
|
878
|
+
|
879
|
+
offset: function (el) {
|
880
|
+
var x = -this.offsetX(el),
|
881
|
+
y = -el.offsetTop;
|
882
|
+
|
883
|
+
// jshint -W084
|
884
|
+
while (el = el.offsetParent) {
|
885
|
+
x -= this.offsetX(el);
|
886
|
+
y -= el.offsetTop;
|
887
|
+
}
|
888
|
+
// jshint +W084
|
889
|
+
|
890
|
+
return {
|
891
|
+
x: x,
|
892
|
+
y: y
|
893
|
+
};
|
894
|
+
},
|
895
|
+
|
881
896
|
getComputedPosition: function () {
|
882
897
|
var matrix = window.getComputedStyle(this.scroller, null),
|
883
898
|
x, y;
|
884
899
|
|
885
900
|
if ( this.options.useTransform ) {
|
886
901
|
matrix = matrix[utils.style.transform].split(')')[0].split(', ');
|
887
|
-
x =
|
902
|
+
x = this.dir * (matrix[12] || matrix[4]);
|
888
903
|
y = +(matrix[13] || matrix[5]);
|
889
904
|
} else {
|
890
905
|
x = +matrix.left.replace(/[^-\d]/g, '');
|
@@ -1098,7 +1113,7 @@ IScroll.prototype = {
|
|
1098
1113
|
n = -1;
|
1099
1114
|
|
1100
1115
|
for ( ; i < l; i++ ) {
|
1101
|
-
if ( i === 0 || el[i]
|
1116
|
+
if ( i === 0 || this.offsetX(el[i]) <= this.offsetX(el[i-1]) ) {
|
1102
1117
|
m = 0;
|
1103
1118
|
n++;
|
1104
1119
|
}
|
@@ -1107,7 +1122,7 @@ IScroll.prototype = {
|
|
1107
1122
|
this.pages[m] = [];
|
1108
1123
|
}
|
1109
1124
|
|
1110
|
-
x = Math.max(-el[i]
|
1125
|
+
x = Math.max(-this.offsetX(el[i]), this.maxScrollX);
|
1111
1126
|
y = Math.max(-el[i].offsetTop, this.maxScrollY);
|
1112
1127
|
cx = x - Math.round(el[i].offsetWidth / 2);
|
1113
1128
|
cy = y - Math.round(el[i].offsetHeight / 2);
|
@@ -1435,7 +1450,7 @@ IScroll.prototype = {
|
|
1435
1450
|
if ( now >= destTime ) {
|
1436
1451
|
that.isAnimating = false;
|
1437
1452
|
that._translate(destX, destY);
|
1438
|
-
|
1453
|
+
|
1439
1454
|
if ( !that.resetPosition(that.options.bounceTime) ) {
|
1440
1455
|
that._execEvent('scrollEnd');
|
1441
1456
|
}
|
@@ -1736,7 +1751,7 @@ Indicator.prototype = {
|
|
1736
1751
|
this.indicatorWidth = this.indicator.clientWidth;
|
1737
1752
|
}
|
1738
1753
|
this.maxPosX = this.wrapperWidth - this.indicatorWidth;
|
1739
|
-
this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
|
1754
|
+
this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
|
1740
1755
|
}
|
1741
1756
|
|
1742
1757
|
if ( this.options.listenY ) {
|
@@ -1770,7 +1785,7 @@ Indicator.prototype = {
|
|
1770
1785
|
y = 0;
|
1771
1786
|
} else if ( y > this.maxPosY ) {
|
1772
1787
|
y = this.maxPosY;
|
1773
|
-
}
|
1788
|
+
}
|
1774
1789
|
}
|
1775
1790
|
|
1776
1791
|
this.x = x;
|