Merge branch 'release/0.0.15'
This commit is contained in:
commit
70e53ba509
|
@ -72,10 +72,6 @@ body {
|
|||
padding: 20px;
|
||||
}
|
||||
|
||||
.momo-page {
|
||||
box-shadow: 0 0 20px #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
.momo-page-wrapper,
|
||||
.momo-frame-wrapper {
|
||||
min-height: 100%;
|
||||
|
@ -164,6 +160,13 @@ body {
|
|||
transform: translate3d(0, 0, 0);
|
||||
z-index:11;
|
||||
background: url("../img/greyzz.png") repeat scroll 0 0 #FFF;
|
||||
/* -moz-box-shadow: 0px 0px 20px rgba(68,68,68,0.6);
|
||||
-webkit-box-shadow: 0px 0px 20px rgba(68,68,68,0.6);
|
||||
box-shadow: 0px 0px 20px rgba(68,68,68,0.6);
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=3,MakeShadow=true,ShadowOpacity=0.30);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Blur(PixelRadius=3,MakeShadow=true,ShadowOpacity=0.30)";
|
||||
zoom: 1; */
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,10 +190,13 @@ body {
|
|||
display: table;
|
||||
}
|
||||
.parent-navbar-brand {
|
||||
display: table;
|
||||
display: block;
|
||||
height: 60px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.navbar .navbar-brand {
|
||||
padding: 10px 7px;
|
||||
/*padding: 10px 7px;*/
|
||||
padding: 0;
|
||||
float: none;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
|
|
|
@ -103,11 +103,28 @@
|
|||
}
|
||||
|
||||
.ptr-reset .momo-page {
|
||||
-webkit-transform: translate3d( 0, 0, 0 );
|
||||
transform: translate3d( 0, 0, 0 );
|
||||
/*-webkit-transform: translate3d( 0, 0, 0 );
|
||||
transform: translate3d( 0, 0, 0 );*/
|
||||
top: 60px;
|
||||
transition: all .25s ease;
|
||||
}
|
||||
|
||||
.ptr-loading .momo-page {
|
||||
-webkit-transform: translate3d( 0, 50px, 0 );
|
||||
transform: translate3d( 0, 50px, 0 );
|
||||
/*-webkit-transform: translate3d( 0, 50px, 0 );
|
||||
transform: translate3d( 0, 50px, 0 );*/
|
||||
top: 110px;
|
||||
transition: all .25s ease;
|
||||
}
|
||||
.ptr-reset #ptr {
|
||||
/*-webkit-transform: translate3d( 0, 0, 0 );
|
||||
transform: translate3d( 0, 0, 0 );*/
|
||||
top: 0px;
|
||||
transition: all .25s ease;
|
||||
}
|
||||
|
||||
.ptr-loading #ptr {
|
||||
/*-webkit-transform: translate3d( 0, 50px, 0 );
|
||||
transform: translate3d( 0, 50px, 0 );*/
|
||||
top: 60px;
|
||||
transition: all .25s ease;
|
||||
}
|
||||
|
|
|
@ -226,7 +226,9 @@
|
|||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
<!--script type="text/javascript" src="cordova.js"></script-->
|
||||
<script type="text/javascript" src="js/polyfill/Promise.min.js"></script>
|
||||
<script type="text/javascript" src="js/polyfill/transition-end.min.js"></script>
|
||||
<script type="text/javascript" src="js/tmpl.min.js"></script>
|
||||
<script type="text/javascript" src="js/lunr.min.js"></script>
|
||||
<script type="text/javascript" src="js/lunr.stemmer.support.min.js"></script>
|
||||
|
|
|
@ -526,23 +526,33 @@ var app = {
|
|||
// Run some async loading code here
|
||||
//window.location.reload();
|
||||
app.loadManifest(false, function(){
|
||||
for(var page in app.pages){
|
||||
if(typeof app.pages[page].search == 'undefined'){
|
||||
delete app.pages[page];
|
||||
document.getElementById("momo-pages").removeChild(
|
||||
document.getElementById(page)
|
||||
);
|
||||
}
|
||||
}
|
||||
// Regiter pages tree
|
||||
app.pages = [];
|
||||
app.menu = [];
|
||||
app.manifest.id = 'home';
|
||||
app.registerPage(app.manifest);
|
||||
// Render every page
|
||||
for(var page in app.pages){
|
||||
var $page = document.createElement('div');
|
||||
$page.id = app.pages[page].id;
|
||||
$page.className = "momo-page";
|
||||
document.getElementById('momo-pages').appendChild($page);
|
||||
var $page = document.getElementById(page);
|
||||
if(!$page){
|
||||
$page = document.createElement('div');
|
||||
$page.id = app.pages[page].id;
|
||||
$page.className = "momo-page";
|
||||
document.getElementById('momo-pages').appendChild($page);
|
||||
}
|
||||
}
|
||||
|
||||
// Render Homepage
|
||||
//app.render(app.manifest);
|
||||
resolve();
|
||||
if(app.current_page.startsWith('search-')){
|
||||
if(typeof app.pages[app.current_page].search != 'undefined'){
|
||||
app.search(app.current_query);
|
||||
} else {
|
||||
app.navigate(app.current_page);
|
||||
|
@ -687,6 +697,7 @@ var app = {
|
|||
// Register new search results page
|
||||
app.pages[id] = {
|
||||
id: id,
|
||||
search: query,
|
||||
icon: "fa fa-search",
|
||||
title: 'Recherche "'+query+'"',
|
||||
content: results.length ? null : '<div class="well text-center text-muted">Aucun resultat</div>',
|
||||
|
@ -695,10 +706,10 @@ var app = {
|
|||
})
|
||||
};
|
||||
|
||||
var $page;
|
||||
var $page = document.getElementById(id);
|
||||
|
||||
// If search query doesn't exist
|
||||
if(!($page = document.getElementById(id))){
|
||||
if(!$page){
|
||||
// Generate result page view
|
||||
$page = document.createElement('div');
|
||||
$page.id = id
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
/*! promise-polyfill 2.1.0 */
|
||||
!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);
|
|
@ -0,0 +1 @@
|
|||
!function(t){"use strict";var i=function(t,i){this.element=t,this.type=i};i.prototype={add:function(t){this.callback=t,this.element.addEventListener(this.type,this.callback,!1)},remove:function(){this.element.removeEventListener(this.type,this.callback,!1)}};var n=function(t){this.element=t,this.transitionEnd=this.whichTransitionEnd(),this.event=new i(this.element,this.transitionEnd)};n.prototype={whichTransitionEnd:function(){var t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==this.element.style[i])return t[i]},bind:function(t){this.event.add(t)},unbind:function(){this.event.remove()}};var e={list:[],getPosition:function(t){if(Array.prototype.indexOf)return this.list.indexOf(t);for(var i=0,n=this.list.length;n>i;i++)if(this.list[i]===t)return i;return-1},insert:function(t){var i=this.getPosition(t),e=-1!==i;return e||(this.list.push(t),this.list.push(new n(t)),i=this.getPosition(t)),this.list[i+1]}};t.transitionEnd=function(t){if(!t)throw"You need to pass an element as parameter!";var i=t[0]||t,n=e.insert(i);return n}}(window);
|
|
@ -62,7 +62,7 @@ var WebPullToRefresh = (function () {
|
|||
return false;
|
||||
}
|
||||
|
||||
var h = new Hammer( options.contentEl );
|
||||
var h = new Hammer( options.contentEl, { touchAction: 'pan-y'} );
|
||||
|
||||
h.get( 'pan' ).set( { direction: Hammer.DIRECTION_VERTICAL } );
|
||||
|
||||
|
@ -129,8 +129,10 @@ var WebPullToRefresh = (function () {
|
|||
*/
|
||||
var _setContentPan = function() {
|
||||
// Use transforms to smoothly animate elements on desktop and mobile devices
|
||||
options.contentEl.style.transform = options.contentEl.style.webkitTransform = 'translate3d( 0, ' + pan.distance + 'px, 0 )';
|
||||
options.ptrEl.style.transform = options.ptrEl.style.webkitTransform = 'translate3d( 0, ' + ( pan.distance - options.ptrEl.offsetHeight ) + 'px, 0 )';
|
||||
//options.contentEl.style.transform = options.contentEl.style.webkitTransform = 'translate3d( 0, ' + pan.distance + 'px, 0 )';
|
||||
//options.ptrEl.style.transform = options.ptrEl.style.webkitTransform = 'translate3d( 0, ' + ( pan.distance - options.ptrEl.offsetHeight ) + 'px, 0 )';
|
||||
options.contentEl.style.top = (60 + pan.distance) + 'px';
|
||||
options.ptrEl.style.top = (60 + pan.distance - options.ptrEl.offsetHeight) + 'px';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -140,6 +142,7 @@ var WebPullToRefresh = (function () {
|
|||
if ( pan.distance > options.distanceToRefresh ) {
|
||||
bodyClass.add( 'ptr-refresh' );
|
||||
} else {
|
||||
bodyClass.add( 'ptr-pulling' );
|
||||
bodyClass.remove( 'ptr-refresh' );
|
||||
}
|
||||
};
|
||||
|
@ -156,8 +159,11 @@ var WebPullToRefresh = (function () {
|
|||
|
||||
e.preventDefault();
|
||||
|
||||
options.contentEl.style.transform = options.contentEl.style.webkitTransform = '';
|
||||
options.ptrEl.style.transform = options.ptrEl.style.webkitTransform = '';
|
||||
//options.contentEl.style.transform = options.contentEl.style.webkitTransform = '';
|
||||
//options.ptrEl.style.transform = options.ptrEl.style.webkitTransform = '';
|
||||
options.contentEl.style.top = "";//"110px";
|
||||
options.ptrEl.style.top = "";//60px";
|
||||
bodyClass.remove( 'ptr-pulling' );
|
||||
|
||||
if ( document.body.classList.contains( 'ptr-refresh' ) ) {
|
||||
_doLoading();
|
||||
|
@ -176,7 +182,7 @@ var WebPullToRefresh = (function () {
|
|||
bodyClass.add( 'ptr-loading' );
|
||||
|
||||
// If no valid loading function exists, just reset elements
|
||||
if ( ! options.loadingFunction ) {
|
||||
if (typeof options.loadingFunction != 'function') {
|
||||
return _doReset();
|
||||
}
|
||||
|
||||
|
@ -197,13 +203,21 @@ var WebPullToRefresh = (function () {
|
|||
bodyClass.remove( 'ptr-loading' );
|
||||
bodyClass.remove( 'ptr-refresh' );
|
||||
bodyClass.add( 'ptr-reset' );
|
||||
|
||||
setTimeout(function(){
|
||||
bodyClass.remove( 'ptr-reset' );
|
||||
}, 250);
|
||||
|
||||
var bodyClassRemove = function() {
|
||||
bodyClass.remove( 'ptr-reset' );
|
||||
document.body.removeEventListener( 'transitionend', bodyClassRemove, false );
|
||||
};
|
||||
//transitionEnd(options.contentEl).bind(function(){
|
||||
// bodyClass.remove( 'ptr-reset' );
|
||||
// transitionEnd(options.contentEl).unbind();
|
||||
//});
|
||||
|
||||
document.body.addEventListener( 'transitionend', bodyClassRemove, false );
|
||||
//var bodyClassRemove = function() {
|
||||
// options.contentEl.removeEventListener( 'transitionend', bodyClassRemove, false );
|
||||
//};
|
||||
|
||||
//options.contentEl.addEventListener( 'transitionend', bodyClassRemove, false );
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
Reference in New Issue