Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/pmd
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2015-05-15 08:58:33 +0300
committerMadhura Jayaratne <madhura.cj@gmail.com>2015-05-15 08:58:33 +0300
commit98d42b55dc34b28b2fd5f43621ce41065c8f9ed7 (patch)
treec9fa1b873f40c126f414563d065d8008d488bd71 /js/pmd
parentd40dbefe23f9d757959b34d54475b5b24d23c8ef (diff)
Give preference to a page having same name as the db
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/pmd')
-rw-r--r--js/pmd/designer_page.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/pmd/designer_page.js b/js/pmd/designer_page.js
index 9c292e79da..ef0bba6625 100644
--- a/js/pmd/designer_page.js
+++ b/js/pmd/designer_page.js
@@ -91,13 +91,21 @@ function Delete_page(page_id, callback)
function Load_first_page(db, callback)
{
DesignerOfflineDB.loadAllObjects('pdf_pages', function (pages) {
+ var firstPage = null;
for (var i = 0; i < pages.length; i++) {
var page = pages[i];
if (page.db_name == db) {
- callback(page);
- return;
+ // give preference to a page having same name as the db
+ if (page.page_descr == db) {
+ callback(page);
+ return;
+ }
+ if (firstPage == null) {
+ firstPage = page;
+ }
}
}
+ callback(firstPage);
});
}