mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
upgrade angular
This commit is contained in:
@@ -2,33 +2,20 @@
|
||||
const nativeRaf= window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame
|
||||
|
||||
const nativeCancelRaf = window.cancelAnimationFrame ||
|
||||
window.webkitCancelAnimationFrame ||
|
||||
window.webkitCancelRequestAnimationFrame
|
||||
|
||||
export const raf = nativeRaf || function(callback) {
|
||||
let timeCurrent = (new Date()).getTime(),
|
||||
timeDelta;
|
||||
|
||||
/* Dynamically set delay on a per-tick basis to match 60fps. */
|
||||
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671 */
|
||||
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
|
||||
timeLast = timeCurrent + timeDelta;
|
||||
|
||||
return setTimeout(function() { callback(timeCurrent + timeDelta); }, timeDelta);
|
||||
return window.setTimeout(callback, 16.6667)
|
||||
}
|
||||
|
||||
export const rafCancel = nativeRaf ? nativeCancelRaf : function(id) {
|
||||
return window.cancelTimeout(id)
|
||||
}
|
||||
|
||||
export function rafPromise() {
|
||||
return new Promise(resolve => raf(resolve))
|
||||
}
|
||||
|
||||
export const isSVG = val => window.SVGElement && (val instanceof window.SVGElement)
|
||||
|
||||
|
||||
// We only need to test for webkit in our supported browsers. Webkit is the only browser still
|
||||
// using prefixes.
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import {dom} from 'ionic2/util'
|
||||
|
||||
/* Focus Outline
|
||||
* --------------------------------------------------
|
||||
* When a keydown event happens, from a tab key, then the
|
||||
* 'key-input' class is added to the body element so focusable
|
||||
* elements have an outline. On a mousedown or touchstart
|
||||
* event then the 'key-input' class is removed.
|
||||
*/
|
||||
|
||||
|
||||
let isKeyInputEnabled = false
|
||||
|
||||
function keyDown(ev) {
|
||||
if (!isKeyInputEnabled && ev.keyCode == 9) {
|
||||
isKeyInputEnabled = true
|
||||
dom.raf(enableKeyInput)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function enableKeyInput() {
|
||||
document.body.classList[isKeyInputEnabled ? 'add' : 'remove']('key-input')
|
||||
|
||||
if (isKeyInputEnabled) {
|
||||
document.addEventListener('mousedown', pointerDown)
|
||||
document.addEventListener('touchstart', pointerDown)
|
||||
|
||||
} else {
|
||||
document.removeEventListener('mousedown', pointerDown)
|
||||
document.removeEventListener('touchstart', pointerDown)
|
||||
}
|
||||
}
|
||||
|
||||
function pointerDown() {
|
||||
isKeyInputEnabled = false
|
||||
dom.raf(enableKeyInput)
|
||||
}
|
||||
|
||||
|
||||
dom.ready().then(function() {
|
||||
document.addEventListener('keydown', keyDown)
|
||||
})
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as util from 'ionic2/util';
|
||||
import * as util from 'ionic/util';
|
||||
|
||||
export function run() {
|
||||
describe('extend', function() {
|
||||
|
||||
@@ -41,11 +41,6 @@ export function pascalCaseToDashCase(str = '') {
|
||||
})
|
||||
}
|
||||
|
||||
let _uid = 0
|
||||
export function uid() {
|
||||
return _uid++
|
||||
}
|
||||
|
||||
export class Log {
|
||||
static log(...args) {
|
||||
console.log.apply(console, args)
|
||||
|
||||
Reference in New Issue
Block a user