@openui5/sap.ui.core 1.136.4 → 1.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +3 -3
- package/README.md +1 -1
- package/REUSE.toml +8 -29
- package/THIRDPARTY.txt +72 -90
- package/package.json +2 -2
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/Event.js +1 -1
- package/src/sap/base/Eventing.js +1 -1
- package/src/sap/base/config.js +1 -1
- package/src/sap/base/i18n/LanguageFallback.js +18 -2
- package/src/sap/base/i18n/LanguageTag.js +1 -1
- package/src/sap/base/i18n/Localization.js +5 -3
- package/src/sap/base/i18n/ResourceBundle.js +59 -35
- package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +3 -3
- package/src/sap/ui/base/BindingInfo.js +18 -9
- package/src/sap/ui/base/BindingParser.js +13 -6
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -8
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +37 -27
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/base/OwnStatics.js +49 -0
- package/src/sap/ui/core/.library +9 -31
- package/src/sap/ui/core/BusyIndicator.js +8 -8
- package/src/sap/ui/core/Component.js +63 -73
- package/src/sap/ui/core/ComponentContainer.js +34 -4
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +1 -1
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +2 -2
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +13 -11
- package/src/sap/ui/core/Element.js +1 -3
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/ExtensionPoint.js +4 -4
- package/src/sap/ui/core/Fragment.js +10 -6
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/Lib.js +39 -24
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +1 -1
- package/src/sap/ui/core/Manifest.js +1 -1
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +39 -178
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/Theming.js +2 -2
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +16 -57
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/XMLTemplateProcessor.js +5 -1
- package/src/sap/ui/core/_IconRegistry.js +2 -0
- package/src/sap/ui/core/date/UI5Date.js +1 -1
- package/src/sap/ui/core/delegate/ItemNavigation.js +2 -2
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +12 -2
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +5 -3
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/FormatUtils.js +1 -1
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/interaction/KeyboardInteractionDisplay.js +64 -37
- package/src/sap/ui/core/library.js +3 -3
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +6 -6
- package/src/sap/ui/core/messagebundle.properties +58 -28
- package/src/sap/ui/core/messagebundle_mk.properties +3 -3
- package/src/sap/ui/core/mvc/Controller.js +5 -1
- package/src/sap/ui/core/mvc/HTMLView.js +6 -2
- package/src/sap/ui/core/mvc/JSONView.js +6 -2
- package/src/sap/ui/core/mvc/JSView.js +6 -3
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +69 -195
- package/src/sap/ui/core/mvc/XMLView.js +7 -2
- package/src/sap/ui/core/mvc/_ViewFactory.js +196 -0
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/Route.js +197 -13
- package/src/sap/ui/core/routing/Router.js +19 -8
- package/src/sap/ui/core/routing/RouterHashChanger.js +12 -3
- package/src/sap/ui/core/routing/Target.js +714 -61
- package/src/sap/ui/core/routing/TargetCache.js +205 -25
- package/src/sap/ui/core/routing/Targets.js +162 -67
- package/src/sap/ui/core/routing/Views.js +1 -0
- package/src/sap/ui/core/routing/sync/Route.js +1 -1
- package/src/sap/ui/core/routing/sync/Target.js +11 -1
- package/src/sap/ui/core/routing/sync/TargetCache.js +3 -3
- package/src/sap/ui/core/routing/sync/Targets.js +1 -1
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -48
- package/src/sap/ui/core/service/ServiceFactory.js +44 -4
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +356 -353
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +4 -2
- package/src/sap/ui/core/themes/base/base.less +20 -20
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
- package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
- package/src/sap/ui/core/themes/base/global.less +4 -0
- package/src/sap/ui/core/themes/base/skeleton.less +3 -3
- package/src/sap/ui/core/theming/ThemeHelper.js +1 -18
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +4 -4
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/XMLPreprocessor.js +8 -1
- package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +4 -4
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/webc/WebComponent.js +2 -3
- package/src/sap/ui/core/webc/WebComponentMetadata.js +2 -3
- package/src/sap/ui/core/webc/WebComponentRenderer.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientModel.js +2 -2
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/Filter.js +55 -35
- package/src/sap/ui/model/FilterOperator.js +79 -9
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -1
- package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +2 -1
- package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
- package/src/sap/ui/model/analytics/odata4analytics.js +2 -1
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +3 -3
- package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +2 -1
- package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +3 -3
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataModel.js +2 -2
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +20 -17
- package/src/sap/ui/model/odata/v4/ODataBinding.js +2 -2
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +4 -4
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +34 -22
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +60 -22
- package/src/sap/ui/model/odata/v4/ODataModel.js +9 -8
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +2 -2
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataUtils.js +2 -2
- package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +98 -89
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +39 -7
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +32 -26
- package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +10 -4
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +44 -24
- package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +50 -19
- package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +1 -1
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -4
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/Opa.js +14 -2
- package/src/sap/ui/test/Opa5.js +61 -10
- package/src/sap/ui/test/TestUtils.js +6 -2
- package/src/sap/ui/test/generic/GenericTestCollection.js +11 -1
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/thirdparty/datajs.js +13 -10
- package/src/sap/ui/thirdparty/jquery.js +1 -1
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader-autoconfig.js +49 -59
- package/src/ui5loader.js +1 -1
- package/src/sap/ui/core/routing/async/Route.js +0 -186
- package/src/sap/ui/core/routing/async/Target.js +0 -712
- package/src/sap/ui/core/routing/async/TargetCache.js +0 -196
- package/src/sap/ui/core/routing/async/Targets.js +0 -130
- package/src/sap/ui/thirdparty/iscroll-lite.js +0 -603
- package/src/sap/ui/thirdparty/iscroll.js +0 -1104
- package/src/sap/ui/thirdparty/mobiscroll/css/mobiscroll-core.css +0 -416
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-core.js +0 -127
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-datetime.js +0 -818
- package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js +0 -1264
- package/src/sap/ui/thirdparty/swipe-view.js +0 -560
|
@@ -1,560 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* SwipeView v1.0 ~ Copyright (c) 2012 Matteo Spinelli, http://cubiq.org
|
|
3
|
-
* Released under MIT license, http://cubiq.org/license
|
|
4
|
-
*/
|
|
5
|
-
var SwipeView = (function (window, document) {
|
|
6
|
-
var dummyStyle = document.createElement('div').style,
|
|
7
|
-
vendor = (function () {
|
|
8
|
-
var vendors = 't,webkitT,MozT,msT,OT'.split(','),
|
|
9
|
-
t,
|
|
10
|
-
i = 0,
|
|
11
|
-
l = vendors.length;
|
|
12
|
-
|
|
13
|
-
for ( ; i < l; i++ ) {
|
|
14
|
-
t = vendors[i] + 'ransform';
|
|
15
|
-
if ( t in dummyStyle ) {
|
|
16
|
-
return vendors[i].substr(0, vendors[i].length - 1);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return false;
|
|
21
|
-
})(),
|
|
22
|
-
cssVendor = vendor ? '-' + vendor.toLowerCase() + '-' : '',
|
|
23
|
-
|
|
24
|
-
// Style properties
|
|
25
|
-
transform = prefixStyle('transform'),
|
|
26
|
-
transitionDuration = prefixStyle('transitionDuration'),
|
|
27
|
-
|
|
28
|
-
// Browser capabilities
|
|
29
|
-
has3d = prefixStyle('perspective') in dummyStyle,
|
|
30
|
-
hasTouch = 'ontouchstart' in window,
|
|
31
|
-
hasTransform = !!vendor,
|
|
32
|
-
hasTransitionEnd = prefixStyle('transition') in dummyStyle,
|
|
33
|
-
|
|
34
|
-
// Helpers
|
|
35
|
-
translateZ = has3d ? ' translateZ(0)' : '',
|
|
36
|
-
|
|
37
|
-
// Events
|
|
38
|
-
resizeEvent = 'onorientationchange' in window ? 'orientationchange' : 'resize',
|
|
39
|
-
startEvent = hasTouch ? 'touchstart' : 'mousedown',
|
|
40
|
-
moveEvent = hasTouch ? 'touchmove' : 'mousemove',
|
|
41
|
-
endEvent = hasTouch ? 'touchend' : 'mouseup',
|
|
42
|
-
cancelEvent = hasTouch ? 'touchcancel' : 'mouseup',
|
|
43
|
-
transitionEndEvent = (function () {
|
|
44
|
-
if ( vendor === false ) return false;
|
|
45
|
-
|
|
46
|
-
var transitionEnd = {
|
|
47
|
-
'' : 'transitionend',
|
|
48
|
-
'webkit' : 'webkitTransitionEnd',
|
|
49
|
-
'Moz' : 'transitionend',
|
|
50
|
-
'O' : 'oTransitionEnd',
|
|
51
|
-
'ms' : 'MSTransitionEnd'
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return transitionEnd[vendor];
|
|
55
|
-
})(),
|
|
56
|
-
|
|
57
|
-
SwipeView = function (el, options) {
|
|
58
|
-
var i,
|
|
59
|
-
div,
|
|
60
|
-
className,
|
|
61
|
-
pageIndex;
|
|
62
|
-
|
|
63
|
-
this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
|
|
64
|
-
this.options = {
|
|
65
|
-
text: null,
|
|
66
|
-
numberOfPages: 3,
|
|
67
|
-
snapThreshold: null,
|
|
68
|
-
hastyPageFlip: false,
|
|
69
|
-
loop: true
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// User defined options
|
|
73
|
-
for (i in options) this.options[i] = options[i];
|
|
74
|
-
|
|
75
|
-
this.wrapper.style.overflow = 'hidden';
|
|
76
|
-
this.wrapper.style.position = 'relative';
|
|
77
|
-
|
|
78
|
-
this.masterPages = [];
|
|
79
|
-
|
|
80
|
-
div = document.createElement('div');
|
|
81
|
-
//MODIFIED BY SAP
|
|
82
|
-
//make slider id unique
|
|
83
|
-
div.id = this.wrapper.parentElement.id + '-slider';
|
|
84
|
-
//MODIFIED BY SAP
|
|
85
|
-
//changed position to 'absolute', otherwise problems with carousels
|
|
86
|
-
//with a fixed height, for example '156px' or '28em'
|
|
87
|
-
div.style.cssText = 'position:absolute;top:0;height:100%;width:100%;' + cssVendor + 'transition-duration:0;' + cssVendor + 'transform:translateZ(0);' + cssVendor + 'transition-timing-function:ease-out';
|
|
88
|
-
this.wrapper.appendChild(div);
|
|
89
|
-
this.slider = div;
|
|
90
|
-
|
|
91
|
-
this.refreshSize();
|
|
92
|
-
|
|
93
|
-
for (i=-1; i<2; i++) {
|
|
94
|
-
div = document.createElement('div');
|
|
95
|
-
//MODIFIED BY SAP
|
|
96
|
-
//make master page id unique
|
|
97
|
-
div.id = this.wrapper.parentElement.id + '-masterpage-' + (i+1);
|
|
98
|
-
div.style.cssText = cssVendor + 'transform:translateZ(0);position:absolute;top:0;height:100%;width:100%;left:' + i*100 + '%';
|
|
99
|
-
if (!div.dataset) div.dataset = {};
|
|
100
|
-
pageIndex = i == -1 ? this.options.numberOfPages - 1 : i;
|
|
101
|
-
div.dataset.pageIndex = pageIndex;
|
|
102
|
-
div.dataset.upcomingPageIndex = pageIndex;
|
|
103
|
-
|
|
104
|
-
if (!this.options.loop && i == -1) div.style.visibility = 'hidden';
|
|
105
|
-
|
|
106
|
-
this.slider.appendChild(div);
|
|
107
|
-
this.masterPages.push(div);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
className = this.masterPages[1].className;
|
|
111
|
-
this.masterPages[1].className = !className ? 'swipeview-active' : className + ' swipeview-active';
|
|
112
|
-
|
|
113
|
-
window.addEventListener(resizeEvent, this, false);
|
|
114
|
-
this.wrapper.addEventListener(startEvent, this, false);
|
|
115
|
-
this.wrapper.addEventListener(moveEvent, this, false);
|
|
116
|
-
this.wrapper.addEventListener(endEvent, this, false);
|
|
117
|
-
this.slider.addEventListener(transitionEndEvent, this, false);
|
|
118
|
-
// in Opera >= 12 the transitionend event is lowercase so we register both events
|
|
119
|
-
if ( vendor == 'O' ) this.slider.addEventListener(transitionEndEvent.toLowerCase(), this, false);
|
|
120
|
-
//MODIFIED BY SAP
|
|
121
|
-
//Please refer to comment for function 'initialSizeCheck'
|
|
122
|
-
this._bPerformInitialSizeCheck = true;
|
|
123
|
-
/* if (!hasTouch) {
|
|
124
|
-
this.wrapper.addEventListener('mouseout', this, false);
|
|
125
|
-
}*/
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
SwipeView.prototype = {
|
|
129
|
-
currentMasterPage: 1,
|
|
130
|
-
x: 0,
|
|
131
|
-
page: 0,
|
|
132
|
-
pageIndex: 0,
|
|
133
|
-
customEvents: [],
|
|
134
|
-
|
|
135
|
-
onFlip: function (fn) {
|
|
136
|
-
this.wrapper.addEventListener('swipeview-flip', fn, false);
|
|
137
|
-
this.customEvents.push(['flip', fn]);
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
onMoveOut: function (fn) {
|
|
141
|
-
this.wrapper.addEventListener('swipeview-moveout', fn, false);
|
|
142
|
-
this.customEvents.push(['moveout', fn]);
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
onMoveIn: function (fn) {
|
|
146
|
-
this.wrapper.addEventListener('swipeview-movein', fn, false);
|
|
147
|
-
this.customEvents.push(['movein', fn]);
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
onTouchStart: function (fn) {
|
|
151
|
-
this.wrapper.addEventListener('swipeview-touchstart', fn, false);
|
|
152
|
-
this.customEvents.push(['touchstart', fn]);
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
destroy: function () {
|
|
156
|
-
while ( this.customEvents.length ) {
|
|
157
|
-
this.wrapper.removeEventListener('swipeview-' + this.customEvents[0][0], this.customEvents[0][1], false);
|
|
158
|
-
this.customEvents.shift();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Remove the event listeners
|
|
162
|
-
window.removeEventListener(resizeEvent, this, false);
|
|
163
|
-
this.wrapper.removeEventListener(startEvent, this, false);
|
|
164
|
-
this.wrapper.removeEventListener(moveEvent, this, false);
|
|
165
|
-
this.wrapper.removeEventListener(endEvent, this, false);
|
|
166
|
-
this.slider.removeEventListener(transitionEndEvent, this, false);
|
|
167
|
-
|
|
168
|
-
/* if (!hasTouch) {
|
|
169
|
-
this.wrapper.removeEventListener('mouseout', this, false);
|
|
170
|
-
}*/
|
|
171
|
-
//MODIFIED BY SAP
|
|
172
|
-
//remove callback reference
|
|
173
|
-
this.fnLoadingCallback = null;
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
refreshSize: function () {
|
|
177
|
-
this.wrapperWidth = this.wrapper.clientWidth;
|
|
178
|
-
this.wrapperHeight = this.wrapper.clientHeight;
|
|
179
|
-
this.pageWidth = this.wrapperWidth;
|
|
180
|
-
this.maxX = -this.options.numberOfPages * this.pageWidth + this.wrapperWidth;
|
|
181
|
-
this.snapThreshold = this.options.snapThreshold === null ?
|
|
182
|
-
Math.round(this.pageWidth * 0.15) :
|
|
183
|
-
/%/.test(this.options.snapThreshold) ?
|
|
184
|
-
Math.round(this.pageWidth * this.options.snapThreshold.replace('%', '') / 100) :
|
|
185
|
-
this.options.snapThreshold;
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
updatePageCount: function (n) {
|
|
189
|
-
this.options.numberOfPages = n;
|
|
190
|
-
this.maxX = -this.options.numberOfPages * this.pageWidth + this.wrapperWidth;
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
goToPage: function (p) {
|
|
194
|
-
var i;
|
|
195
|
-
|
|
196
|
-
this.masterPages[this.currentMasterPage].className = this.masterPages[this.currentMasterPage].className.replace(/(^|\s)swipeview-active(\s|$)/, '');
|
|
197
|
-
for (i=0; i<3; i++) {
|
|
198
|
-
className = this.masterPages[i].className;
|
|
199
|
-
/(^|\s)swipeview-loading(\s|$)/.test(className) || (this.masterPages[i].className = !className ? 'swipeview-loading' : className + ' swipeview-loading');
|
|
200
|
-
//MODIFIED BY SAP
|
|
201
|
-
//apply class change to carousel callback
|
|
202
|
-
if(this.fnLoadingCallback) {
|
|
203
|
-
this.fnLoadingCallback.call(undefined, i, true);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
p = p < 0 ? 0 : p > this.options.numberOfPages-1 ? this.options.numberOfPages-1 : p;
|
|
208
|
-
this.page = p;
|
|
209
|
-
this.pageIndex = p;
|
|
210
|
-
this.slider.style[transitionDuration] = '0s';
|
|
211
|
-
this.__pos(-p * this.pageWidth);
|
|
212
|
-
|
|
213
|
-
this.currentMasterPage = (this.page + 1) - Math.floor((this.page + 1) / 3) * 3;
|
|
214
|
-
|
|
215
|
-
this.masterPages[this.currentMasterPage].className = this.masterPages[this.currentMasterPage].className + ' swipeview-active';
|
|
216
|
-
|
|
217
|
-
if (this.currentMasterPage === 0) {
|
|
218
|
-
this.masterPages[2].style.left = this.page * 100 - 100 + '%';
|
|
219
|
-
this.masterPages[0].style.left = this.page * 100 + '%';
|
|
220
|
-
this.masterPages[1].style.left = this.page * 100 + 100 + '%';
|
|
221
|
-
|
|
222
|
-
this.masterPages[2].dataset.upcomingPageIndex = this.page === 0 ? this.options.numberOfPages-1 : this.page - 1;
|
|
223
|
-
this.masterPages[0].dataset.upcomingPageIndex = this.page;
|
|
224
|
-
this.masterPages[1].dataset.upcomingPageIndex = this.page == this.options.numberOfPages-1 ? 0 : this.page + 1;
|
|
225
|
-
} else if (this.currentMasterPage == 1) {
|
|
226
|
-
this.masterPages[0].style.left = this.page * 100 - 100 + '%';
|
|
227
|
-
this.masterPages[1].style.left = this.page * 100 + '%';
|
|
228
|
-
this.masterPages[2].style.left = this.page * 100 + 100 + '%';
|
|
229
|
-
|
|
230
|
-
this.masterPages[0].dataset.upcomingPageIndex = this.page === 0 ? this.options.numberOfPages-1 : this.page - 1;
|
|
231
|
-
this.masterPages[1].dataset.upcomingPageIndex = this.page;
|
|
232
|
-
this.masterPages[2].dataset.upcomingPageIndex = this.page == this.options.numberOfPages-1 ? 0 : this.page + 1;
|
|
233
|
-
} else {
|
|
234
|
-
this.masterPages[1].style.left = this.page * 100 - 100 + '%';
|
|
235
|
-
this.masterPages[2].style.left = this.page * 100 + '%';
|
|
236
|
-
this.masterPages[0].style.left = this.page * 100 + 100 + '%';
|
|
237
|
-
|
|
238
|
-
this.masterPages[1].dataset.upcomingPageIndex = this.page === 0 ? this.options.numberOfPages-1 : this.page - 1;
|
|
239
|
-
this.masterPages[2].dataset.upcomingPageIndex = this.page;
|
|
240
|
-
this.masterPages[0].dataset.upcomingPageIndex = this.page == this.options.numberOfPages-1 ? 0 : this.page + 1;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
this.__flip();
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
next: function () {
|
|
247
|
-
//MODIFIED BY SAP: using pageIndex instead of this.x because it leads to errors
|
|
248
|
-
if (!this.options.loop && this.pageIndex === this.options.numberOfPages - 1) return;
|
|
249
|
-
//MODIFIED BY SAP
|
|
250
|
-
//Please refer to comment for function 'initialSizeCheck'
|
|
251
|
-
this.initialSizeCheck();
|
|
252
|
-
this.directionX = -1;
|
|
253
|
-
this.x -= 1;
|
|
254
|
-
this.__checkPosition();
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
prev: function () {
|
|
258
|
-
//MODIFIED BY SAP: using pageIndex instead of this.x because it leads to errors
|
|
259
|
-
if (!this.options.loop && this.pageIndex === 0) return;
|
|
260
|
-
//MODIFIED BY SAP
|
|
261
|
-
//Please refer to comment for function 'initialSizeCheck'
|
|
262
|
-
this.initialSizeCheck();
|
|
263
|
-
this.directionX = 1;
|
|
264
|
-
this.x += 1;
|
|
265
|
-
this.__checkPosition();
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
handleEvent: function (e) {
|
|
269
|
-
switch (e.type) {
|
|
270
|
-
case startEvent:
|
|
271
|
-
this.__start(e);
|
|
272
|
-
break;
|
|
273
|
-
case moveEvent:
|
|
274
|
-
this.__move(e);
|
|
275
|
-
break;
|
|
276
|
-
case cancelEvent:
|
|
277
|
-
case endEvent:
|
|
278
|
-
this.__end(e);
|
|
279
|
-
break;
|
|
280
|
-
case resizeEvent:
|
|
281
|
-
//MODIFIED BY SAP
|
|
282
|
-
//Use sap.ui.core.ResizeHandler instead
|
|
283
|
-
//this.__resize();
|
|
284
|
-
break;
|
|
285
|
-
case transitionEndEvent:
|
|
286
|
-
case 'otransitionend':
|
|
287
|
-
if (e.target == this.slider && !this.options.hastyPageFlip) this.__flip();
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
//MODIFIED BY SAP
|
|
293
|
-
//If the default width is set the swipeview has a bug when calculating the swipe
|
|
294
|
-
//distance. if that distance is wrong, controls are not centered after a
|
|
295
|
-
//swipe. To fix that bug, swipe view's 'refreshSize' function is called once initially
|
|
296
|
-
//after first rendering. Therefore, the additional function 'initialSizeCheck' has been introduced
|
|
297
|
-
initialSizeCheck: function() {
|
|
298
|
-
if(this._bPerformInitialSizeCheck) {
|
|
299
|
-
this.refreshSize();
|
|
300
|
-
this._bPerformInitialSizeCheck = false;
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
*
|
|
307
|
-
* Pseudo private methods
|
|
308
|
-
*
|
|
309
|
-
*/
|
|
310
|
-
__pos: function (x) {
|
|
311
|
-
this.x = x;
|
|
312
|
-
this.slider.style[transform] = 'translate(' + x + 'px,0)' + translateZ;
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
__resize: function () {
|
|
316
|
-
this.refreshSize();
|
|
317
|
-
this.slider.style[transitionDuration] = '0s';
|
|
318
|
-
this.__pos(-this.page * this.pageWidth);
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
__start: function (e) {
|
|
322
|
-
//e.preventDefault();
|
|
323
|
-
|
|
324
|
-
// BEGIN: MODIFIED BY SAP
|
|
325
|
-
//if move event has already been consumed by let's say switch ore slider control,
|
|
326
|
-
//we should not act on it any more
|
|
327
|
-
if(!!e.originalEvent && !!e.originalEvent._sapui_handledByControl) {
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
// END: MODIFIED BY SAP
|
|
331
|
-
|
|
332
|
-
if (this.initiated) return;
|
|
333
|
-
var point = hasTouch ? e.touches[0] : e;
|
|
334
|
-
|
|
335
|
-
this.initiated = true;
|
|
336
|
-
this.moved = false;
|
|
337
|
-
this.thresholdExceeded = false;
|
|
338
|
-
this.startX = point.pageX;
|
|
339
|
-
this.startY = point.pageY;
|
|
340
|
-
this.pointX = point.pageX;
|
|
341
|
-
this.pointY = point.pageY;
|
|
342
|
-
this.stepsX = 0;
|
|
343
|
-
this.stepsY = 0;
|
|
344
|
-
this.directionX = 0;
|
|
345
|
-
this.directionLocked = false;
|
|
346
|
-
|
|
347
|
-
/* var matrix = getComputedStyle(this.slider, null).webkitTransform.replace(/[^0-9-.,]/g, '').split(',');
|
|
348
|
-
this.x = matrix[4] * 1;*/
|
|
349
|
-
|
|
350
|
-
this.slider.style[transitionDuration] = '0s';
|
|
351
|
-
|
|
352
|
-
this.__event('touchstart');
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
__move: function (e) {
|
|
356
|
-
if (!this.initiated) return;
|
|
357
|
-
|
|
358
|
-
var point = hasTouch ? e.touches[0] : e,
|
|
359
|
-
deltaX = point.pageX - this.pointX,
|
|
360
|
-
deltaY = point.pageY - this.pointY,
|
|
361
|
-
newX = this.x + deltaX,
|
|
362
|
-
dist = Math.abs(point.pageX - this.startX);
|
|
363
|
-
|
|
364
|
-
this.moved = true;
|
|
365
|
-
this.pointX = point.pageX;
|
|
366
|
-
this.pointY = point.pageY;
|
|
367
|
-
this.directionX = deltaX > 0 ? 1 : deltaX < 0 ? -1 : 0;
|
|
368
|
-
this.stepsX += Math.abs(deltaX);
|
|
369
|
-
this.stepsY += Math.abs(deltaY);
|
|
370
|
-
|
|
371
|
-
// We take a 10px buffer to figure out the direction of the swipe
|
|
372
|
-
if (this.stepsX < 10 && this.stepsY < 10) {
|
|
373
|
-
// e.preventDefault();
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// We are scrolling vertically, so skip SwipeView and give the control back to the browser
|
|
378
|
-
if (!this.directionLocked && this.stepsY > this.stepsX) {
|
|
379
|
-
this.initiated = false;
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
e.preventDefault();
|
|
384
|
-
|
|
385
|
-
this.directionLocked = true;
|
|
386
|
-
|
|
387
|
-
if (!this.options.loop && (newX > 0 || newX < this.maxX)) {
|
|
388
|
-
// BEGIN: MODIFIED BY SAP
|
|
389
|
-
//Make sure rubber band effect is only shown for IOS
|
|
390
|
-
if(sap.ui.Device.os.ios) {
|
|
391
|
-
newX = this.x + (deltaX / 2);
|
|
392
|
-
} else {
|
|
393
|
-
//No rubber-band for non ios!
|
|
394
|
-
if(newX > 0 ) {
|
|
395
|
-
newX = 0;
|
|
396
|
-
} else {
|
|
397
|
-
newX = this.maxX;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
// END: MODIFIED BY SAP
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
if (!this.thresholdExceeded && dist >= this.snapThreshold) {
|
|
404
|
-
this.thresholdExceeded = true;
|
|
405
|
-
this.__event('moveout');
|
|
406
|
-
} else if (this.thresholdExceeded && dist < this.snapThreshold) {
|
|
407
|
-
this.thresholdExceeded = false;
|
|
408
|
-
this.__event('movein');
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/* if (newX > 0 || newX < this.maxX) {
|
|
412
|
-
newX = this.x + (deltaX / 2);
|
|
413
|
-
}*/
|
|
414
|
-
|
|
415
|
-
this.__pos(newX);
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
__end: function (e) {
|
|
419
|
-
if (!this.initiated) return;
|
|
420
|
-
|
|
421
|
-
var point = hasTouch ? e.changedTouches[0] : e,
|
|
422
|
-
dist = Math.abs(point.pageX - this.startX);
|
|
423
|
-
|
|
424
|
-
this.initiated = false;
|
|
425
|
-
|
|
426
|
-
if (!this.moved) return;
|
|
427
|
-
|
|
428
|
-
// BEGIN: MODIFIED BY SAP
|
|
429
|
-
//Make sure rubber band effect is shown for left-
|
|
430
|
-
//and rightmost pages, too
|
|
431
|
-
var bMoveBack = false;
|
|
432
|
-
if (!this.options.loop && (this.x > 0 || this.x < this.maxX)) {
|
|
433
|
-
this.__event('movein');
|
|
434
|
-
bMoveBack = true;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// Check if we exceeded the snap threshold
|
|
438
|
-
if (bMoveBack || dist < this.snapThreshold) {
|
|
439
|
-
this.slider.style[transitionDuration] = Math.floor(100 * dist / this.snapThreshold) + 'ms';
|
|
440
|
-
this.__pos(-this.page * this.pageWidth);
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
// END: MODIFIED BY SAP
|
|
444
|
-
|
|
445
|
-
this.__checkPosition();
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
-
__checkPosition: function () {
|
|
449
|
-
var pageFlip,
|
|
450
|
-
pageFlipIndex,
|
|
451
|
-
className;
|
|
452
|
-
|
|
453
|
-
// BEGIN: MODIFIED BY SAP
|
|
454
|
-
//Make sure that swipe works correctly in loop mode with less than 3 pages
|
|
455
|
-
if(this.options.loop) {
|
|
456
|
-
if(this.options.numberOfPages === 1) {
|
|
457
|
-
this.goToPage(0);
|
|
458
|
-
} else if(this.options.numberOfPages === 2) {
|
|
459
|
-
if (this.directionX < 0) {
|
|
460
|
-
if(this.page === 1) {
|
|
461
|
-
this.goToPage(0);
|
|
462
|
-
}
|
|
463
|
-
} else {
|
|
464
|
-
if(this.page === 0) {
|
|
465
|
-
this.goToPage(1);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
// END: MODIFIED BY SAP
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
this.masterPages[this.currentMasterPage].className = this.masterPages[this.currentMasterPage].className.replace(/(^|\s)swipeview-active(\s|$)/, '');
|
|
474
|
-
|
|
475
|
-
// Flip the page
|
|
476
|
-
if (this.directionX > 0) {
|
|
477
|
-
this.page = -Math.ceil(this.x / this.pageWidth);
|
|
478
|
-
this.currentMasterPage = (this.page + 1) - Math.floor((this.page + 1) / 3) * 3;
|
|
479
|
-
this.pageIndex = this.pageIndex === 0 ? this.options.numberOfPages - 1 : this.pageIndex - 1;
|
|
480
|
-
|
|
481
|
-
pageFlip = this.currentMasterPage - 1;
|
|
482
|
-
pageFlip = pageFlip < 0 ? 2 : pageFlip;
|
|
483
|
-
this.masterPages[pageFlip].style.left = this.page * 100 - 100 + '%';
|
|
484
|
-
|
|
485
|
-
pageFlipIndex = this.page - 1;
|
|
486
|
-
} else {
|
|
487
|
-
this.page = -Math.floor(this.x / this.pageWidth);
|
|
488
|
-
this.currentMasterPage = (this.page + 1) - Math.floor((this.page + 1) / 3) * 3;
|
|
489
|
-
this.pageIndex = this.pageIndex == this.options.numberOfPages - 1 ? 0 : this.pageIndex + 1;
|
|
490
|
-
|
|
491
|
-
pageFlip = this.currentMasterPage + 1;
|
|
492
|
-
pageFlip = pageFlip > 2 ? 0 : pageFlip;
|
|
493
|
-
this.masterPages[pageFlip].style.left = this.page * 100 + 100 + '%';
|
|
494
|
-
|
|
495
|
-
pageFlipIndex = this.page + 1;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
// Add active class to current page
|
|
499
|
-
className = this.masterPages[this.currentMasterPage].className;
|
|
500
|
-
/(^|\s)swipeview-active(\s|$)/.test(className) || (this.masterPages[this.currentMasterPage].className = !className ? 'swipeview-active' : className + ' swipeview-active');
|
|
501
|
-
|
|
502
|
-
// Add loading class to flipped page
|
|
503
|
-
className = this.masterPages[pageFlip].className;
|
|
504
|
-
/(^|\s)swipeview-loading(\s|$)/.test(className) || (this.masterPages[pageFlip].className = !className ? 'swipeview-loading' : className + ' swipeview-loading');
|
|
505
|
-
//MODIFIED BY SAP
|
|
506
|
-
//apply class change to carousel callback
|
|
507
|
-
if(this.fnLoadingCallback) {
|
|
508
|
-
this.fnLoadingCallback.call(undefined, pageFlip, true);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
pageFlipIndex = pageFlipIndex - Math.floor(pageFlipIndex / this.options.numberOfPages) * this.options.numberOfPages;
|
|
512
|
-
this.masterPages[pageFlip].dataset.upcomingPageIndex = pageFlipIndex; // Index to be loaded in the newly flipped page
|
|
513
|
-
|
|
514
|
-
newX = -this.page * this.pageWidth;
|
|
515
|
-
|
|
516
|
-
this.slider.style[transitionDuration] = Math.floor(500 * Math.abs(this.x - newX) / this.pageWidth) + 'ms';
|
|
517
|
-
|
|
518
|
-
// Hide the next page if we decided to disable looping
|
|
519
|
-
if (!this.options.loop) {
|
|
520
|
-
this.masterPages[pageFlip].style.visibility = newX === 0 || newX == this.maxX ? 'hidden' : '';
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
if (this.x == newX) {
|
|
524
|
-
this.__flip(); // If we swiped all the way long to the next page (extremely rare but still)
|
|
525
|
-
} else {
|
|
526
|
-
this.__pos(newX);
|
|
527
|
-
if (this.options.hastyPageFlip) this.__flip();
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
__flip: function () {
|
|
532
|
-
//MODIFIED BY SAP
|
|
533
|
-
//Please refer to comment for function 'initialSizeCheck'
|
|
534
|
-
this.initialSizeCheck();
|
|
535
|
-
this.__event('flip');
|
|
536
|
-
|
|
537
|
-
for (var i=0; i<3; i++) {
|
|
538
|
-
this.masterPages[i].className = this.masterPages[i].className.replace(/(^|\s)swipeview-loading(\s|$)/, ''); // Remove the loading class
|
|
539
|
-
this.masterPages[i].dataset.pageIndex = this.masterPages[i].dataset.upcomingPageIndex;
|
|
540
|
-
}
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
__event: function (type) {
|
|
544
|
-
var ev = document.createEvent("Event");
|
|
545
|
-
|
|
546
|
-
ev.initEvent('swipeview-' + type, true, true);
|
|
547
|
-
|
|
548
|
-
this.wrapper.dispatchEvent(ev);
|
|
549
|
-
}
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
function prefixStyle (style) {
|
|
553
|
-
if ( vendor === '' ) return style;
|
|
554
|
-
|
|
555
|
-
style = style.charAt(0).toUpperCase() + style.substr(1);
|
|
556
|
-
return vendor + style;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return SwipeView;
|
|
560
|
-
})(window, document);
|