Commit 982f4ff5 authored by Sven Franck's avatar Sven Franck

bugfix: called refresh on table vs. table.table

parent f5d1263a
This diff is collapsed.
......@@ -172,9 +172,8 @@
// enhance elements in the table rows
//.trigger("create") > breaks the table on 2nd run
.closest('table')
// refresh table
.filter(function() { return $(this).jqmData('bound') === true; })
.trigger('tablerefresh')
.table('refresh')
.end()
.closest('table')
// create table on first run
......@@ -266,14 +265,9 @@
timer = null;
gadget.filter_value = val;
renderData(gadget.sort_field, gadget.sort_direction, val);
},1000);
},500);
}
})
// delete filter value
.on('click.results_filter', '.ui-input-clear', function () {
var val = "";
renderData(gadget.sort_field, gadget.sort_direction, val);
})
// unbind on hide (block with jqmData/class prevents multiple calls?
.off('pagehide','results_filter');
});
......
......@@ -142,7 +142,50 @@ define([], function () {
};
// ===========================================================
// debug timer
(function( $, window, undefined ) {
function getTime() {
return ( new Date() ).getTime();
}
var startChange, stopChange, startLoad, stopLoad, startEnhance, stopEnhance, startTransition, stopTransition, lock = 0;
$( document )
.bind( "pagebeforechange", function( e, data) {
if ( typeof data.toPage === "string" ) {
startChange = stopChange = startLoad = stopLoad = startEnhance = stopEnhance = startTransition = stopTransition = getTime();
}
})
.bind( "pagebeforeload", function() {
startLoad = stopLoad = getTime();
})
.bind( "pagebeforecreate", function() {
if ( ++lock === 1 ) {
stopLoad = startEnhance = stopEnhance = getTime();
}
})
.bind( "pageinit", function() {
if ( --lock === 0 ) {
stopEnhance = getTime();
}
})
.bind( "pagebeforeshow", function() {
startTransition = stopTransition = getTime();
})
.bind( "pageshow", function() {
stopTransition = getTime();
})
.bind( "pagechange", function( e, data ) {
if ( typeof data.toPage === "object" ) {
stopChange = getTime();
console.log("load + processing: " + ( stopLoad - startLoad )+ "\nenhance: " + ( stopEnhance - startEnhance )+ "\ntransition: " + ( stopTransition - startTransition )+ "\ntotalTime: " + ( stopChange - startChange ) );
startChange = stopChange = startLoad = stopLoad = startEnhance = stopEnhance = startTransition = stopTransition = 0;
}
});
})( jQuery, window );
// global page handling
$(document).on('pagecreate', 'div:jqmData(role="page")', function() {
......
......@@ -6,6 +6,8 @@
(function (scope) {
"use strict";
console.log("aloha in scope - complexqueries");
console.log(scope)
Object.defineProperty(scope, "ComplexQueries", {
configurable: false,
enumerable: false,
......@@ -35,15 +37,15 @@ Object.defineProperty(scope.ComplexQueries, "parse", {
This is in the public domain.
*/
var _dbg_withtrace = false;
var _dbg_string = new String();
var NODEJS__dbg_withtrace = false;
var NODEJS__dbg_string = new String();
function __dbg_print( text )
function __NODEJS_dbg_print( text )
{
_dbg_string += text + "\n";
NODEJS__dbg_string += text + "\n";
}
function __lex( info )
function __NODEJS_lex( info )
{
var state = 0;
var match = -1;
......@@ -249,7 +251,7 @@ switch( state )
}
function __parse( src, err_off, err_la )
function __NODEJS_parse( src, err_off, err_la )
{
var sstack = new Array();
var vstack = new Array();
......@@ -377,7 +379,7 @@ var labels = new Array(
sstack.push( 0 );
vstack.push( 0 );
la = __lex( info );
la = __NODEJS_lex( info );
while( true )
{
......@@ -391,9 +393,9 @@ var labels = new Array(
}
}
if( _dbg_withtrace && sstack.length > 0 )
if( NODEJS__dbg_withtrace && sstack.length > 0 )
{
__dbg_print( "\nState " + sstack[sstack.length-1] + "\n" +
__NODEJS_dbg_print( "\nState " + sstack[sstack.length-1] + "\n" +
"\tLookahead: " + labels[la] + " (\"" + info.att + "\")\n" +
"\tAction: " + act + "\n" +
"\tSource: \"" + info.src.substr( info.offset, 30 ) + ( ( info.offset + 30 < info.src.length ) ?
......@@ -406,8 +408,8 @@ var labels = new Array(
//Panic-mode: Try recovery when parse-error occurs!
if( act == 25 )
{
if( _dbg_withtrace )
__dbg_print( "Error detected: There is no reduce or shift on the symbol " + labels[la] );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Error detected: There is no reduce or shift on the symbol " + labels[la] );
err_cnt++;
err_off.push( info.offset - info.att.length );
......@@ -426,8 +428,8 @@ var labels = new Array(
while( act == 25 && la != 19 )
{
if( _dbg_withtrace )
__dbg_print( "\tError recovery\n" +
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery\n" +
"Current lookahead: " + labels[la] + " (" + info.att + ")\n" +
"Action: " + act + "\n\n" );
if( la == -1 )
......@@ -461,19 +463,19 @@ var labels = new Array(
vstack.push( rvstack[i] );
}
la = __lex( info );
la = __NODEJS_lex( info );
}
if( act == 25 )
{
if( _dbg_withtrace )
__dbg_print( "\tError recovery failed, terminating parse process..." );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery failed, terminating parse process..." );
break;
}
if( _dbg_withtrace )
__dbg_print( "\tError recovery succeeded, continuing" );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery succeeded, continuing" );
}
/*
......@@ -485,29 +487,29 @@ var labels = new Array(
//Shift
if( act > 0 )
{
if( _dbg_withtrace )
__dbg_print( "Shifting symbol: " + labels[la] + " (" + info.att + ")" );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Shifting symbol: " + labels[la] + " (" + info.att + ")" );
sstack.push( act );
vstack.push( info.att );
la = __lex( info );
la = __NODEJS_lex( info );
if( _dbg_withtrace )
__dbg_print( "\tNew lookahead symbol: " + labels[la] + " (" + info.att + ")" );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tNew lookahead symbol: " + labels[la] + " (" + info.att + ")" );
}
//Reduce
else
{
act *= -1;
if( _dbg_withtrace )
__dbg_print( "Reducing by producution: " + act );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Reducing by producution: " + act );
rval = void(0);
if( _dbg_withtrace )
__dbg_print( "\tPerforming semantic action..." );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPerforming semantic action..." );
switch( act )
{
......@@ -595,8 +597,8 @@ switch( act )
if( _dbg_withtrace )
__dbg_print( "\tPopping " + pop_tab[act][1] + " off the stack..." );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPopping " + pop_tab[act][1] + " off the stack..." );
for( var i = 0; i < pop_tab[act][1]; i++ )
{
......@@ -617,24 +619,24 @@ switch( act )
if( act == 0 )
break;
if( _dbg_withtrace )
__dbg_print( "\tPushing non-terminal " + labels[ pop_tab[act][0] ] );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPushing non-terminal " + labels[ pop_tab[act][0] ] );
sstack.push( go );
vstack.push( rval );
}
if( _dbg_withtrace )
if( NODEJS__dbg_withtrace )
{
alert( _dbg_string );
_dbg_string = new String();
alert( NODEJS__dbg_string );
NODEJS__dbg_string = new String();
}
}
if( _dbg_withtrace )
if( NODEJS__dbg_withtrace )
{
__dbg_print( "\nParse complete." );
alert( _dbg_string );
__NODEJS_dbg_print( "\nParse complete." );
alert( NODEJS__dbg_string );
}
return err_cnt;
......@@ -689,7 +691,7 @@ var error_offsets = [];
var error_lookaheads = [];
var error_count = 0;
var result;
if ( ( error_count = __parse( string, error_offsets, error_lookaheads ) ) > 0 ) {
if ( ( error_count = __NODEJS_parse( string, error_offsets, error_lookaheads ) ) > 0 ) {
var i;
for (i = 0; i < error_count; ++i) {
throw new Error ( "Parse error near \"" +
......@@ -888,12 +890,16 @@ Object.defineProperty(scope.ComplexQueries,"query",{
////////////////////////////////////////////////////////////
result_list = [], result_list_tmp = [], j;
object_list = object_list || [];
for (j=0; j<object_list.length; ++j) {
if ( itemMatchesQuery (
object_list[j], scope.ComplexQueries.parse (query.query)
)) {
result_list.push(object_list[j]);
}
if (query.query === undefined) {
result_list = object_list;
} else {
for (j=0; j<object_list.length; ++j) {
if ( itemMatchesQuery(
object_list[j], scope.ComplexQueries.parse(query.query)
)) {
result_list.push(object_list[j]);
}
}
}
if (query.filter) {
select(result_list,query.filter.select_list || []);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment