added global veriables and fixed variable images per page

This commit is contained in:
bluesaxman 2019-04-29 09:27:40 -06:00
parent a88b920606
commit d346e90e13
5 changed files with 5 additions and 4 deletions

View File

@ -8,6 +8,7 @@ function getWidget(type) {
if (typeof imageViewElements !== "function") {getJavascript(path+"imageViewElements");}
}
if ("gallery" == type) {
window.g_Gallery = {"pageCount":5, "parentID":"body"};
if (typeof getGalleries !== "function") {getJavascript(path+"getGalleries");}
if (typeof putGalleries !== "function") {getJavascript(path+"putGalleries");}
if (typeof listGalleries !== "function") {getJavascript(path+"listGalleries");}

View File

@ -1,5 +1,5 @@
function ImageListSelection(position,count) {
count = "number" == typeof count ? count : 5;
count = "number" == typeof count ? count : window.g_Gallery.pageCount;
var selection = window.curGallery.imageList.slice(position,position+count);
window.curGallery.container.list.innerHTML = "";
selection.forEach( function (e,i) {

View File

@ -1,5 +1,5 @@
function initGalery(galleryName, pageCount) {
pageCount = "number" == typeof pageCount ? pageCount : 5;
pageCount = "number" == typeof pageCount ? pageCount : window.g_Gallery.pageCount;
window.curGallery = {};
getImageList(window.api_url, galleryName);
window.curGallery.Position = 0;

View File

@ -1,5 +1,5 @@
function listGalleries() {
window.galleryBox = elementPlace("body","GalleryBox",null,"div");
window.galleryBox = elementPlace(window.g_Gallery.parentID,"GalleryBox",null,"div");
window.galleryList = elementPlace("#GalleryBox","GalleryList",null,"ul");
window.galleryList.innerHTML = "";
window.galleriesList.forEach(function(e) {