|
|
@@ -1796,6 +1796,14 @@ class phpQueryObject
|
|
|
}
|
|
|
$this->elements = $stack;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * used for ordering results in find()
|
|
|
+ */
|
|
|
+ private function cmpByLineNo($a , $b) {
|
|
|
+ return $a->getLineNo() <= $b->getLineNo() ? -1 : 1;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Enter description here...
|
|
|
*
|
|
|
@@ -1958,6 +1966,7 @@ class phpQueryObject
|
|
|
if (! $this->elementsContainsNode($node, $stack))
|
|
|
$stack[] = $node;
|
|
|
}
|
|
|
+ usort($stack, array('phpQueryObject', 'cmpByLineNo'));
|
|
|
$this->elements = $stack;
|
|
|
return $this->newInstance();
|
|
|
}
|
|
|
@@ -5700,4 +5709,4 @@ set_include_path(
|
|
|
phpQuery::$plugins = new phpQueryPlugins();
|
|
|
// include bootstrap file (personal library config)
|
|
|
if (file_exists(dirname(__FILE__).'/phpQuery/bootstrap.php'))
|
|
|
- require_once dirname(__FILE__).'/phpQuery/bootstrap.php';
|
|
|
+ require_once dirname(__FILE__).'/phpQuery/bootstrap.php';
|