@openui5/sap.ui.core 1.108.19 → 1.108.21
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/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +1 -1
- 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/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 +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +1 -1
- 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/core/.library +1 -7
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +60 -42
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- 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 +1 -1
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +1 -1
- 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/Fragment.js +1 -1
- 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/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/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +15 -19
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- 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 +1 -1
- 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/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- 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 +1 -1
- package/src/sap/ui/core/messagebundle_ar.properties +6 -6
- package/src/sap/ui/core/messagebundle_bg.properties +13 -13
- package/src/sap/ui/core/messagebundle_ca.properties +6 -6
- package/src/sap/ui/core/messagebundle_cs.properties +2 -2
- package/src/sap/ui/core/messagebundle_cy.properties +2 -2
- package/src/sap/ui/core/messagebundle_da.properties +4 -4
- package/src/sap/ui/core/messagebundle_de.properties +2 -2
- package/src/sap/ui/core/messagebundle_el.properties +9 -9
- package/src/sap/ui/core/messagebundle_es.properties +8 -8
- package/src/sap/ui/core/messagebundle_et.properties +9 -9
- package/src/sap/ui/core/messagebundle_fi.properties +2 -2
- package/src/sap/ui/core/messagebundle_fr.properties +43 -43
- package/src/sap/ui/core/messagebundle_hi.properties +1 -1
- package/src/sap/ui/core/messagebundle_hr.properties +11 -11
- package/src/sap/ui/core/messagebundle_hu.properties +7 -7
- package/src/sap/ui/core/messagebundle_id.properties +4 -4
- package/src/sap/ui/core/messagebundle_it.properties +30 -30
- package/src/sap/ui/core/messagebundle_ja.properties +31 -31
- package/src/sap/ui/core/messagebundle_kk.properties +15 -15
- package/src/sap/ui/core/messagebundle_ko.properties +25 -25
- package/src/sap/ui/core/messagebundle_lt.properties +3 -3
- package/src/sap/ui/core/messagebundle_lv.properties +13 -13
- package/src/sap/ui/core/messagebundle_ms.properties +23 -23
- package/src/sap/ui/core/messagebundle_nl.properties +22 -22
- package/src/sap/ui/core/messagebundle_no.properties +9 -9
- package/src/sap/ui/core/messagebundle_pl.properties +6 -6
- package/src/sap/ui/core/messagebundle_pt.properties +8 -8
- package/src/sap/ui/core/messagebundle_ro.properties +11 -11
- package/src/sap/ui/core/messagebundle_ru.properties +24 -24
- package/src/sap/ui/core/messagebundle_sk.properties +1 -1
- package/src/sap/ui/core/messagebundle_sl.properties +12 -12
- package/src/sap/ui/core/messagebundle_sv.properties +4 -4
- package/src/sap/ui/core/messagebundle_th.properties +8 -8
- package/src/sap/ui/core/messagebundle_tr.properties +4 -4
- package/src/sap/ui/core/messagebundle_uk.properties +6 -6
- package/src/sap/ui/core/messagebundle_vi.properties +3 -3
- package/src/sap/ui/core/messagebundle_zh_TW.properties +49 -49
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +1 -1
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- 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/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/core/themes/base/base.less +275 -269
- package/src/sap/ui/core/themes/base/global.less +16 -16
- 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 +1 -1
- 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/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/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 +15 -6
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientModel.js +1 -1
- 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/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/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 +1 -1
- 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/ODataListBinding.js +78 -44
- package/src/sap/ui/model/odata/v2/ODataModel.js +2 -3
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataBinding.js +17 -2
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +9 -5
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +4 -7
- 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 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/performance/BeaconRequest.js +8 -10
- 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/generic/TestBase.js +1 -1
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/ui5loader-autoconfig.js +0 -4
- package/src/sap/ui/thirdparty/mobify-carousel.js +0 -733
|
@@ -1,733 +0,0 @@
|
|
|
1
|
-
var Mobify = window.Mobify = window.Mobify || {};
|
|
2
|
-
Mobify.$ = Mobify.$ || window.Zepto || window.jQuery;
|
|
3
|
-
// MODIFIED BY SAP: changed classPrefix from 'm-' to ''
|
|
4
|
-
Mobify.UI = Mobify.UI || { classPrefix: '' };
|
|
5
|
-
|
|
6
|
-
(function($, document) {
|
|
7
|
-
$.support = $.support || {};
|
|
8
|
-
|
|
9
|
-
// BEGIN: MODIFIED BY SAP
|
|
10
|
-
var support = {
|
|
11
|
-
'touch': 'ontouchend' in document
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// => if the device API is loaded we override the touch detection
|
|
15
|
-
if (window.sap && sap.ui && sap.ui.Device && sap.ui.Device.support) {
|
|
16
|
-
support.touch = sap.ui.Device.support.touch
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
$.extend($.support, support);
|
|
20
|
-
// END: MODIFIED BY SAP
|
|
21
|
-
|
|
22
|
-
})(Mobify.$, document);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
@module Holds common functions relating to UI.
|
|
28
|
-
*/
|
|
29
|
-
Mobify.UI.Utils = (function($) {
|
|
30
|
-
var exports = {}
|
|
31
|
-
, has = $.support;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
Events (either touch or mouse)
|
|
35
|
-
*/
|
|
36
|
-
// BEGIN: MODIFIED BY SAP
|
|
37
|
-
exports.events = {
|
|
38
|
-
down: 'touchstart mousedown',
|
|
39
|
-
move: 'touchmove mousemove',
|
|
40
|
-
up: 'touchend touchcancel mouseup'
|
|
41
|
-
};
|
|
42
|
-
// END: MODIFIED BY SAP
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
Returns the position of a mouse or touch event in (x, y)
|
|
46
|
-
@function
|
|
47
|
-
@param {Event} touch or mouse event
|
|
48
|
-
@returns {Object} X and Y coordinates
|
|
49
|
-
*/
|
|
50
|
-
// BEGIN: MODIFIED BY SAP
|
|
51
|
-
exports.getCursorPosition = function(e) {
|
|
52
|
-
e = e.originalEvent || e;
|
|
53
|
-
var oTouches = e.touches && e.touches[0];
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
x: oTouches ? oTouches.clientX : e.clientX,
|
|
57
|
-
y: oTouches ? oTouches.clientY : e.clientY
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// END: MODIFIED BY SAP
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
Returns prefix property for current browser.
|
|
64
|
-
@param {String} CSS Property Name
|
|
65
|
-
@return {String} Detected CSS Property Name
|
|
66
|
-
*/
|
|
67
|
-
exports.getProperty = function(name) {
|
|
68
|
-
var prefixes = ['Webkit', 'Moz', 'O', 'ms', '']
|
|
69
|
-
, testStyle = document.createElement('div').style;
|
|
70
|
-
|
|
71
|
-
for (var i = 0; i < prefixes.length; ++i) {
|
|
72
|
-
if (testStyle[prefixes[i] + name] !== undefined) {
|
|
73
|
-
return prefixes[i] + name;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Not Supported
|
|
78
|
-
return;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
$.extend(has, {
|
|
82
|
-
'transform': !! (exports.getProperty('Transform'))
|
|
83
|
-
, 'transform3d': !! (window.WebKitCSSMatrix && 'm11' in new WebKitCSSMatrix())
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// translateX(element, delta)
|
|
87
|
-
// Moves the element by delta (px)
|
|
88
|
-
var transformProperty = exports.getProperty('Transform');
|
|
89
|
-
if (has.transform3d) {
|
|
90
|
-
exports.translateX = function(element, delta) {
|
|
91
|
-
if (typeof delta == 'number') delta = delta + 'px';
|
|
92
|
-
element.style[transformProperty] = 'translate3d(' + delta + ',0,0)';
|
|
93
|
-
};
|
|
94
|
-
} else if (has.transform) {
|
|
95
|
-
exports.translateX = function(element, delta) {
|
|
96
|
-
if (typeof delta == 'number') delta = delta + 'px';
|
|
97
|
-
element.style[transformProperty] = 'translate(' + delta + ',0)';
|
|
98
|
-
};
|
|
99
|
-
} else {
|
|
100
|
-
exports.translateX = function(element, delta) {
|
|
101
|
-
if (typeof delta == 'number') delta = delta + 'px';
|
|
102
|
-
element.style.left = delta;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// setTransitions
|
|
107
|
-
var transitionProperty = exports.getProperty('Transition')
|
|
108
|
-
, durationProperty = exports.getProperty('TransitionDuration');
|
|
109
|
-
|
|
110
|
-
exports.setTransitions = function(element, enable) {
|
|
111
|
-
if (enable) {
|
|
112
|
-
element.style[durationProperty] = '';
|
|
113
|
-
} else {
|
|
114
|
-
element.style[durationProperty] = '0s';
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// Request Animation Frame
|
|
120
|
-
// courtesy of @paul_irish
|
|
121
|
-
exports.requestAnimationFrame = (function() {
|
|
122
|
-
var prefixed = (window.requestAnimationFrame ||
|
|
123
|
-
window.webkitRequestAnimationFrame ||
|
|
124
|
-
window.mozRequestAnimationFrame ||
|
|
125
|
-
window.oRequestAnimationFrame ||
|
|
126
|
-
window.msRequestAnimationFrame ||
|
|
127
|
-
function( callback ){
|
|
128
|
-
window.setTimeout(callback, 1000 / 60);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
var requestAnimationFrame = function() {
|
|
132
|
-
prefixed.apply(window, arguments);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
return requestAnimationFrame;
|
|
136
|
-
})();
|
|
137
|
-
|
|
138
|
-
return exports;
|
|
139
|
-
|
|
140
|
-
})(Mobify.$);
|
|
141
|
-
|
|
142
|
-
Mobify.UI.Carousel = (function($, Utils) {
|
|
143
|
-
var defaults = {
|
|
144
|
-
dragRadius: 10
|
|
145
|
-
, moveRadius: 20
|
|
146
|
-
, classPrefix: undefined
|
|
147
|
-
, classNames: {
|
|
148
|
-
outer: 'sapMCrsl'
|
|
149
|
-
, inner: 'sapMCrslInner'
|
|
150
|
-
, item: 'sapMCrslItem'
|
|
151
|
-
, center: 'sapMCrslCenter'
|
|
152
|
-
, touch: 'has-touch'
|
|
153
|
-
, dragging: 'dragging'
|
|
154
|
-
, active: 'sapMCrslActive'
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
, has = $.support;
|
|
158
|
-
|
|
159
|
-
// Constructor
|
|
160
|
-
var Carousel = function(element, options) {
|
|
161
|
-
this.setOptions(options);
|
|
162
|
-
this.initElements(element);
|
|
163
|
-
this.initOffsets();
|
|
164
|
-
this.initAnimation();
|
|
165
|
-
this.bind();
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
// Expose Dfaults
|
|
169
|
-
Carousel.defaults = defaults;
|
|
170
|
-
|
|
171
|
-
Carousel.prototype.setOptions = function(opts) {
|
|
172
|
-
var options = $.extend(this.options || {}, defaults, opts);
|
|
173
|
-
|
|
174
|
-
/* classNames requires a deep copy */
|
|
175
|
-
options.classNames = $.extend({}, options.classNames, opts.classNames || {});
|
|
176
|
-
|
|
177
|
-
/* By default, classPrefix is `undefined`, which means to use the Mobify-wide level prefix */
|
|
178
|
-
options.classPrefix = options.classPrefix || Mobify.UI.classPrefix;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
this.options = options;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
Carousel.prototype.initElements = function(element) {
|
|
185
|
-
this._index = 1;
|
|
186
|
-
|
|
187
|
-
this.element = element;
|
|
188
|
-
this.$element = $(element);
|
|
189
|
-
this.$inner = this.$element.find('> .' + this._getClass('inner'));
|
|
190
|
-
this.$items = this.$inner.children();
|
|
191
|
-
|
|
192
|
-
this.$start = this.$items.eq(0);
|
|
193
|
-
this.$sec = this.$items.eq(1);
|
|
194
|
-
this.$current = this.$items.eq(this._index);
|
|
195
|
-
|
|
196
|
-
this._length = this.$items.length;
|
|
197
|
-
this._alignment = this.$element.hasClass(this._getClass('center')) ? 0.5 : 0;
|
|
198
|
-
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
Carousel.prototype.initOffsets = function() {
|
|
202
|
-
this._offset = 0;
|
|
203
|
-
this._offsetDrag = 0;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
Carousel.prototype.initAnimation = function() {
|
|
207
|
-
this.animating = false;
|
|
208
|
-
this.dragging = false;
|
|
209
|
-
this._hasActiveTransition = false;
|
|
210
|
-
this._needsUpdate = false;
|
|
211
|
-
this._sTransitionEvents = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
|
|
212
|
-
this._enableAnimation();
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
Carousel.prototype._getClass = function(id) {
|
|
217
|
-
return this.options.classPrefix + this.options.classNames[id];
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
Carousel.prototype._enableAnimation = function() {
|
|
222
|
-
if (this.animating) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
Utils.setTransitions(this.$inner[0], true);
|
|
227
|
-
this.$inner.removeClass(this._getClass('dragging'));
|
|
228
|
-
this.animating = true;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
Carousel.prototype._disableAnimation = function() {
|
|
232
|
-
if (!this.animating) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
Utils.setTransitions(this.$inner[0], false);
|
|
237
|
-
this.$inner.addClass(this._getClass('dragging'));
|
|
238
|
-
this.animating = false;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
Carousel.prototype.update = function() {
|
|
242
|
-
/* We throttle calls to the real `_update` for efficiency */
|
|
243
|
-
if (this._needsUpdate) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
var self = this;
|
|
248
|
-
this._needsUpdate = true;
|
|
249
|
-
Utils.requestAnimationFrame(function() {
|
|
250
|
-
self._update();
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
Carousel.prototype._update = function() {
|
|
255
|
-
var $current,
|
|
256
|
-
currentOffset,
|
|
257
|
-
x;
|
|
258
|
-
|
|
259
|
-
if (!this._needsUpdate) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
$current = this.$items.eq(this._index - 1);
|
|
264
|
-
currentOffset = $current.prop('offsetLeft') + $current.prop('clientWidth') * this._alignment,
|
|
265
|
-
startOffset = this.$start.prop('offsetLeft') + this.$start.prop('clientWidth') * this._alignment
|
|
266
|
-
|
|
267
|
-
this._offset = -(currentOffset - startOffset);
|
|
268
|
-
x = Math.round(this._offset + this._offsetDrag);
|
|
269
|
-
|
|
270
|
-
if(this.$inner) {
|
|
271
|
-
Utils.translateX(this.$inner[0], x);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
this._needsUpdate = false;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// MODIFIED BY SAP
|
|
278
|
-
//added loop getter and setter
|
|
279
|
-
Carousel.prototype.setLoop = function(bLoop) {
|
|
280
|
-
this._bLoop = bLoop;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
Carousel.prototype.getLoop = function() {
|
|
284
|
-
return this._bLoop;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
//setter and getter for right-to-left mode
|
|
288
|
-
Carousel.prototype.setRTL = function(bRTL) {
|
|
289
|
-
this._bRTL = bRTL;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
Carousel.prototype.getRTL = function() {
|
|
293
|
-
return this._bRTL;
|
|
294
|
-
}
|
|
295
|
-
// MODIFIED BY SAP
|
|
296
|
-
//added private changeAnimation function
|
|
297
|
-
Carousel.prototype.changeAnimation = function(sTransitionClass, fnCallback, oCallbackContext, aCallbackParams) {
|
|
298
|
-
if ( this.$inner ){
|
|
299
|
-
var $carouselInner = this.$inner,
|
|
300
|
-
sTransitionEvents = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
|
|
301
|
-
|
|
302
|
-
var fnCleanUpTransition = function(){
|
|
303
|
-
$carouselInner.off(sTransitionEvents, fnCleanUpTransition);
|
|
304
|
-
$carouselInner.removeClass(sTransitionClass);
|
|
305
|
-
//Exexute callback function if there is one.
|
|
306
|
-
if(fnCallback) {
|
|
307
|
-
fnCallback.apply(oCallbackContext, aCallbackParams);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
$carouselInner.addClass(sTransitionClass);
|
|
312
|
-
$carouselInner.on(sTransitionEvents, fnCleanUpTransition);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// MODIFIED BY SAP
|
|
317
|
-
//added resize function
|
|
318
|
-
Carousel.prototype.resize = function() {
|
|
319
|
-
this.changeAnimation('sapMCrslHideNonActive');
|
|
320
|
-
|
|
321
|
-
this.update();
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
Carousel.prototype.touchstart = function(e) {
|
|
325
|
-
if(this._fnStart) {
|
|
326
|
-
this._fnStart.call(this, e);
|
|
327
|
-
} else {
|
|
328
|
-
jQuery.sap.log.warning("Mobify's 'start' method not available yet.");
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
Carousel.prototype.touchmove = function(e) {
|
|
333
|
-
// BEGIN: MODIFIED BY SAP
|
|
334
|
-
if (jQuery(e.target).is("input, textarea, select, [contenteditable='true']")) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
// END: MODIFIED BY SAP
|
|
338
|
-
|
|
339
|
-
if(this._fnDrag) {
|
|
340
|
-
this._fnDrag.call(this, e);
|
|
341
|
-
} else {
|
|
342
|
-
jQuery.sap.log.warning("Mobify's 'drag' method not available yet.")
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
Carousel.prototype.touchend = function(e) {
|
|
347
|
-
if(this._fnEnd) {
|
|
348
|
-
this._fnEnd.call(this, e);
|
|
349
|
-
} else {
|
|
350
|
-
jQuery.sap.log.warning("Mobify's 'end' method not available yet.")
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
Carousel.prototype.bind = function() {
|
|
357
|
-
var abs = Math.abs
|
|
358
|
-
, dragging = false
|
|
359
|
-
, canceled = false
|
|
360
|
-
, dragRadius = this.options.dragRadius
|
|
361
|
-
, xy
|
|
362
|
-
, dx
|
|
363
|
-
, dy
|
|
364
|
-
, dragThresholdMet
|
|
365
|
-
, self = this
|
|
366
|
-
, $element = this.$element
|
|
367
|
-
, $inner = this.$inner
|
|
368
|
-
, opts = this.options
|
|
369
|
-
, dragLimit = this.$element.width()
|
|
370
|
-
, lockLeft = false
|
|
371
|
-
, lockRight = false;
|
|
372
|
-
|
|
373
|
-
// MODIFIED BY SAP
|
|
374
|
-
//make functions 'start', 'drag' and 'end' available to
|
|
375
|
-
//containing carousel control.
|
|
376
|
-
if(!self._fnStart) {
|
|
377
|
-
self._fnStart = function start(e) {
|
|
378
|
-
|
|
379
|
-
// BEGIN: MODIFIED BY SAP
|
|
380
|
-
if (e.isMarked("delayedMouseEvent")) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
//add event handler flags
|
|
385
|
-
var oElement = jQuery(e.target).control(0);
|
|
386
|
-
if(oElement instanceof sap.m.Slider ||
|
|
387
|
-
oElement instanceof sap.m.Switch ||
|
|
388
|
-
oElement instanceof sap.m.IconTabBar) {
|
|
389
|
-
//Make sure that swipe is executed for all controls except those that
|
|
390
|
-
//themselves require horizontal swiping
|
|
391
|
-
canceled = true;
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
// END: MODIFIED BY SAP
|
|
395
|
-
|
|
396
|
-
dragging = true;
|
|
397
|
-
canceled = false;
|
|
398
|
-
|
|
399
|
-
xy = Utils.getCursorPosition(e);
|
|
400
|
-
dx = 0;
|
|
401
|
-
dy = 0;
|
|
402
|
-
dragThresholdMet = false;
|
|
403
|
-
|
|
404
|
-
// Disable smooth transitions
|
|
405
|
-
self._disableAnimation();
|
|
406
|
-
|
|
407
|
-
lockLeft = self._index == 1;
|
|
408
|
-
lockRight = self._index == self._length;
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
self._fnDrag = function drag(e) {
|
|
412
|
-
|
|
413
|
-
// BEGIN: MODIFIED BY SAP
|
|
414
|
-
if (!dragging || canceled || e.isMarked("delayedMouseEvent")) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
// mark the event for components that needs to know if the event was handled by the carousel
|
|
418
|
-
e.setMarked();
|
|
419
|
-
// END: MODIFIED BY SAP
|
|
420
|
-
|
|
421
|
-
var newXY = Utils.getCursorPosition(e);
|
|
422
|
-
dx = xy.x - newXY.x;
|
|
423
|
-
dy = xy.y - newXY.y;
|
|
424
|
-
|
|
425
|
-
if (dragThresholdMet || abs(dx) > abs(dy) && (abs(dx) > dragRadius)) {
|
|
426
|
-
dragThresholdMet = true;
|
|
427
|
-
e.preventDefault();
|
|
428
|
-
|
|
429
|
-
if (lockLeft && (dx < 0)) {
|
|
430
|
-
dx = dx * (-dragLimit)/(dx - dragLimit);
|
|
431
|
-
} else if (lockRight && (dx > 0)) {
|
|
432
|
-
dx = dx * (dragLimit)/(dx + dragLimit);
|
|
433
|
-
}
|
|
434
|
-
self._offsetDrag = -dx;
|
|
435
|
-
self.update();
|
|
436
|
-
} else if ((abs(dy) > abs(dx)) && (abs(dy) > dragRadius)) {
|
|
437
|
-
canceled = true;
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
self._fnEnd = function end(e) {
|
|
442
|
-
|
|
443
|
-
// BEGIN: MODIFIED BY SAP
|
|
444
|
-
if (!dragging || e.isMarked("delayedMouseEvent")) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
// END: MODIFIED BY SAP
|
|
448
|
-
|
|
449
|
-
dragging = false;
|
|
450
|
-
|
|
451
|
-
self._enableAnimation();
|
|
452
|
-
|
|
453
|
-
if (!canceled && abs(dx) > opts.moveRadius) {
|
|
454
|
-
// Move to the next slide if necessary
|
|
455
|
-
if (dx > 0) {
|
|
456
|
-
self.getRTL() ? self.prev() : self.next();
|
|
457
|
-
} else {
|
|
458
|
-
self.getRTL() ? self.next() : self.prev();
|
|
459
|
-
}
|
|
460
|
-
} else {
|
|
461
|
-
// Reset back to regular position
|
|
462
|
-
self._offsetDrag = 0;
|
|
463
|
-
self.update();
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
function click(e) {
|
|
470
|
-
if (dragThresholdMet) {
|
|
471
|
-
e.preventDefault();
|
|
472
|
-
//When 'dragThresholdMet' the carousel will switch to
|
|
473
|
-
//the next page. Therefore no other action shall be performed on
|
|
474
|
-
//the current page
|
|
475
|
-
e.stopPropagation();
|
|
476
|
-
e.setMarked();
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// BEGIN: MODIFIED BY SAP
|
|
481
|
-
$inner
|
|
482
|
-
.on('click.carousel', click)
|
|
483
|
-
.on('mouseout.carousel', self._fnEnd);
|
|
484
|
-
// END: MODIFIED BY SAP
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
$element.on('click', '[data-slide]', function(e){
|
|
488
|
-
|
|
489
|
-
// BEGIN: MODIFIED BY SAP
|
|
490
|
-
// The event might bubble up from another carousel inside of this one.
|
|
491
|
-
// In this case we ignore the event.
|
|
492
|
-
var oCarousel = jQuery(e.target).closest('.sapMCrsl');
|
|
493
|
-
if (oCarousel[0] != $element[0]) {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
// END: MODIFIED BY SAP
|
|
497
|
-
|
|
498
|
-
e.preventDefault();
|
|
499
|
-
var action = $(this).attr('data-slide')
|
|
500
|
-
, index = parseInt(action, 10);
|
|
501
|
-
|
|
502
|
-
if (isNaN(index)) {
|
|
503
|
-
self[action]();
|
|
504
|
-
} else {
|
|
505
|
-
// MODIFIED BY SAP deactivate move on
|
|
506
|
-
//bullet press
|
|
507
|
-
//self.move(index);
|
|
508
|
-
}
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
$element.on('afterSlide', function(e, previousSlide, nextSlide) {
|
|
512
|
-
var iFirstElement = nextSlide - 1,
|
|
513
|
-
sActiveClass = self._getClass('active');
|
|
514
|
-
|
|
515
|
-
// The event might bubble up from another carousel inside of this one.
|
|
516
|
-
// In this case we ignore the event.
|
|
517
|
-
if (e.target != this) {
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
var sId = self.$element[0].id,
|
|
522
|
-
sPageIndicatorId = sId.replace(/(:|\.)/g,'\\$1') + '-pageIndicator';
|
|
523
|
-
|
|
524
|
-
// self.$items.eq(previousSlide - 1).removeClass(self._getClass('active'));
|
|
525
|
-
for (var i = iFirstElement; i < iFirstElement + self.options.numberOfItemsToShow; i++) {
|
|
526
|
-
var element = self.$items.eq(i);
|
|
527
|
-
element.addClass(sActiveClass);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
self.$element.find('#' + sPageIndicatorId + ' > [data-slide=\'' + previousSlide + '\']').removeClass(self._getClass('active'));
|
|
531
|
-
self.$element.find('#' + sPageIndicatorId + ' > [data-slide=\'' + nextSlide + '\']').addClass(self._getClass('active'));
|
|
532
|
-
});
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
$element.trigger('beforeSlide', [1, 1]);
|
|
536
|
-
$element.trigger('afterSlide', [1, 1]);
|
|
537
|
-
|
|
538
|
-
self.update();
|
|
539
|
-
|
|
540
|
-
};
|
|
541
|
-
|
|
542
|
-
Carousel.prototype.unbind = function() {
|
|
543
|
-
this.$inner.off();
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
// BEGIN: MODIFIED BY SAP
|
|
547
|
-
Carousel.prototype.onTransitionComplete = function() {
|
|
548
|
-
this.$inner.off(this._sTransitionEvents, this.onTransitionComplete);
|
|
549
|
-
|
|
550
|
-
var sActiveClass = this._getClass('active'),
|
|
551
|
-
i;
|
|
552
|
-
|
|
553
|
-
for (i = 0; i < this.$items.length; i++) {
|
|
554
|
-
if (i != this._index - 1) {
|
|
555
|
-
this.$items.eq(i).removeClass(sActiveClass);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
this._hasActiveTransition = false;
|
|
560
|
-
|
|
561
|
-
// Trigger afterSlide event
|
|
562
|
-
this.$element.trigger('afterSlide', [this._prevIndex, this._index]);
|
|
563
|
-
this.setShouldFireEvent(false);
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
Carousel.prototype.getShouldFireEvent = function() {
|
|
567
|
-
return this._shouldFireEvent;
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
Carousel.prototype.setShouldFireEvent = function(bShouldFireEvent) {
|
|
571
|
-
this._shouldFireEvent = bShouldFireEvent;
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
Carousel.prototype.hasActiveTransition = function() {
|
|
575
|
-
return this._hasActiveTransition;
|
|
576
|
-
};
|
|
577
|
-
// END: MODIFIED BY SAP
|
|
578
|
-
|
|
579
|
-
Carousel.prototype.destroy = function() {
|
|
580
|
-
this.unbind();
|
|
581
|
-
this.$element.trigger('destroy');
|
|
582
|
-
this.$element.remove();
|
|
583
|
-
|
|
584
|
-
// Cleanup
|
|
585
|
-
this.$element = null;
|
|
586
|
-
this.$inner = null;
|
|
587
|
-
this.$start = null;
|
|
588
|
-
this.$current = null;
|
|
589
|
-
|
|
590
|
-
this._needsUpdate = false;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
Carousel.prototype.move = function(newIndex, opts) {
|
|
594
|
-
//if list is empty or transition is in process , return
|
|
595
|
-
// MODIFIED BY SAP
|
|
596
|
-
if(this._length === 0 || this._hasActiveTransition == true) {
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
var $element = this.$element
|
|
601
|
-
, $inner = this.$inner
|
|
602
|
-
, $items = this.$items
|
|
603
|
-
, $start = this.$start
|
|
604
|
-
, $current = this.$current
|
|
605
|
-
, length = this._length
|
|
606
|
-
, index = this._index;
|
|
607
|
-
|
|
608
|
-
opts = opts || {};
|
|
609
|
-
|
|
610
|
-
// BEGIN: MODIFIED BY SAP
|
|
611
|
-
// prevent loop when carousel shows more pages than 1
|
|
612
|
-
if (this.getLoop() && this.options.numberOfItemsToShow !== 1 &&
|
|
613
|
-
(newIndex < 1 || newIndex > this._length)) { // new index out of range - will cause loop
|
|
614
|
-
return;
|
|
615
|
-
}
|
|
616
|
-
// END: MODIFIED BY SAP
|
|
617
|
-
|
|
618
|
-
// Bound Values between [1, length];
|
|
619
|
-
if (newIndex < 1) {
|
|
620
|
-
// MODIFIED BY SAP
|
|
621
|
-
//if looping move to last index
|
|
622
|
-
if(this._bLoop) {
|
|
623
|
-
// this.changeAnimation('sapMCrslNoTransition');
|
|
624
|
-
newIndex = this._length;
|
|
625
|
-
} else {
|
|
626
|
-
newIndex = 1;
|
|
627
|
-
}
|
|
628
|
-
} else if (newIndex > this._length) {
|
|
629
|
-
// MODIFIED BY SAP
|
|
630
|
-
//if looping move to first index
|
|
631
|
-
if(this._bLoop) {
|
|
632
|
-
// this.changeAnimation('sapMCrslNoTransition');
|
|
633
|
-
newIndex = 1;
|
|
634
|
-
} else {
|
|
635
|
-
newIndex = length;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
if (newIndex + this.options.numberOfItemsToShow > this._length) {
|
|
640
|
-
newIndex = this._length - this.options.numberOfItemsToShow + 1;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
// Bail out early if no move is necessary.
|
|
644
|
-
var bTriggerEvents = true;
|
|
645
|
-
if (newIndex == this._index) {
|
|
646
|
-
// MODIFIED BY SAP
|
|
647
|
-
//only trigger events if index changes
|
|
648
|
-
bTriggerEvents = false;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
// Trigger beforeSlide event
|
|
652
|
-
if(bTriggerEvents) {
|
|
653
|
-
$element.trigger('beforeSlide', [index, newIndex]);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
this._offsetDrag = 0;
|
|
657
|
-
this._prevIndex = this._index;
|
|
658
|
-
this._index = newIndex;
|
|
659
|
-
this.update();
|
|
660
|
-
|
|
661
|
-
// MODIFIED BY SAP
|
|
662
|
-
if(bTriggerEvents) {
|
|
663
|
-
// This indicates that transition has started
|
|
664
|
-
this._hasActiveTransition = true;
|
|
665
|
-
$inner.bind(this._sTransitionEvents, jQuery.proxy(this.onTransitionComplete, this));
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
Carousel.prototype.next = function() {
|
|
670
|
-
this.setShouldFireEvent(true);
|
|
671
|
-
this.move(this._index + 1);
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
Carousel.prototype.prev = function() {
|
|
675
|
-
this.setShouldFireEvent(true);
|
|
676
|
-
this.move(this._index - 1);
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
return Carousel;
|
|
680
|
-
|
|
681
|
-
})(Mobify.$, Mobify.UI.Utils);
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
(function($) {
|
|
686
|
-
/**
|
|
687
|
-
jQuery interface to set up a carousel
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
@param {String} [action] Action to perform. When no action is passed, the carousel is simply initialized.
|
|
691
|
-
@param {Object} [options] Options passed to the action.
|
|
692
|
-
*/
|
|
693
|
-
$.fn.carousel = function (action, options) {
|
|
694
|
-
var initOptions = $.extend({}, $.fn.carousel.defaults, options);
|
|
695
|
-
|
|
696
|
-
// Handle different calling conventions
|
|
697
|
-
if (typeof action == 'object') {
|
|
698
|
-
initOptions = $(initOptions, action);
|
|
699
|
-
options = null;
|
|
700
|
-
action = null;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
this.each(function () {
|
|
704
|
-
var $this = $(this)
|
|
705
|
-
, carousel = this._carousel;
|
|
706
|
-
|
|
707
|
-
if (!carousel) {
|
|
708
|
-
carousel = new Mobify.UI.Carousel(this, initOptions);
|
|
709
|
-
} else {
|
|
710
|
-
carousel.setOptions(initOptions);
|
|
711
|
-
carousel.initElements(this);
|
|
712
|
-
carousel.initOffsets();
|
|
713
|
-
carousel.initAnimation();
|
|
714
|
-
carousel.bind();
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if (action) {
|
|
718
|
-
carousel[action](options);
|
|
719
|
-
|
|
720
|
-
if (action === 'destroy') {
|
|
721
|
-
carousel = null;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
this._carousel = carousel;
|
|
726
|
-
})
|
|
727
|
-
|
|
728
|
-
return this;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
$.fn.carousel.defaults = {};
|
|
732
|
-
|
|
733
|
-
})(Mobify.$);
|