]> git.proxmox.com Git - extjs.git/blob - extjs/packages/legacy/modern/src/device/accelerometer/Abstract.js
add extjs 6.0.1 sources
[extjs.git] / extjs / packages / legacy / modern / src / device / accelerometer / Abstract.js
1 /**
2 * @private
3 */
4 Ext.define('Ext.device.accelerometer.Abstract', {
5 config: {
6 /**
7 * @cfg {Number} frequency The default frequency to get the current acceleration when using {@link Ext.device.Accelerometer#watchAcceleration}.
8 */
9 frequency: 10000
10 },
11
12 getCurrentAcceleration: function(config) {
13 // <debug>
14 if (!config.success) {
15 Ext.Logger.warn('You need to specify a `success` function for #getCurrentAcceleration');
16 }
17 // </debug>
18
19 return config;
20 },
21
22 watchAcceleration: function(config) {
23 var defaultConfig = Ext.device.accelerometer.Abstract.prototype.config;
24
25 config = Ext.applyIf(config, {
26 frequency: defaultConfig.frequency
27 });
28
29 // <debug>
30 if (!config.callback) {
31 Ext.Logger.warn('You need to specify a `callback` function for #watchAcceleration');
32 }
33 // </debug>
34
35 return config;
36 },
37
38 clearWatch: Ext.emptyFn
39 });