Skip to content

Commit a566c14

Browse files
authored
Merge pull request #6 from javaxt-project/dev
1.0.9
2 parents 372e769 + e915870 commit a566c14

File tree

10 files changed

+4448
-4307
lines changed

10 files changed

+4448
-4307
lines changed

LICENSE.TXT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2006-2024, Peter Borissow
1+
Copyright (c) 2006-2025, Peter Borissow
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

src/button/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ javaxt.dhtml.Button = function(parent, config) {
201201

202202
//Create outer div used to hold the button, mask, and menu
203203
var outerDiv = createElement('div', parent);
204-
outerDiv.setAttribute("desc", me.className);
204+
outerDiv.className = "javaxt-button";
205205
outerDiv.style.display = config.display;
206206
if (config.width){
207207
if (typeof config.width === "string"){

src/carousel/Carousel.js

+45-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,42 @@ if(!javaxt.dhtml) javaxt.dhtml={};
99
* can cycle through the panels using the back() and next() functions. The
1010
* carousel can store a fixed set of panels or you can create the illusion
1111
* of having infinite panels by updating panels when they are out of view.
12+
* Example:
13+
<pre>
14+
var carousel = new javaxt.dhtml.Carousel(parent,{
15+
loop: true,
16+
animate: true
17+
});
18+
</pre>
19+
* Once the carousel is instantiated you can call any of the public methods.
20+
* The first thing to do is to add panels. Example:
21+
<pre>
22+
var p1 = document.createElement('div');
23+
p1.style.background = "#f0f8ff";
24+
p1.style.height = "100%";
25+
carousel.add(p1);
26+
27+
var p2 = document.createElement('div');
28+
p2.style.background = "#96a5b2";
29+
p2.style.height = "100%";
30+
carousel.add(p2);
31+
32+
var p3 = document.createElement('div');
33+
p3.style.background = "#ffd8d6";
34+
p3.style.height = "100%";
35+
carousel.add(p3);
36+
</pre>
37+
* After panels have been added to the carousel, you can call the back() and
38+
* next() methods to switch panels. Typically these methods are called from
39+
* "onclick" events fired from other DOM elements (e.g. button).
40+
*
41+
* Finally, you can also add event listeners by overriding any of the public
42+
* "on" or "before" methods like this:
43+
<pre>
44+
carousel.onChange = function(currPanel, prevPanel){
45+
console.log("currPanel", currPanel);
46+
};
47+
</pre>
1248
*
1349
******************************************************************************/
1450

@@ -140,7 +176,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
140176
height: "100%",
141177
position: "relative"
142178
});
143-
outerDiv.setAttribute("desc", me.className);
179+
outerDiv.className = "javaxt-carousel";
144180
me.el = outerDiv;
145181

146182

@@ -337,6 +373,8 @@ javaxt.dhtml.Carousel = function(parent, config) {
337373
//**************************************************************************
338374
//** resize
339375
//**************************************************************************
376+
/** Used to force the component to resize to fit the parent container
377+
*/
340378
this.resize = function(){
341379
var w = outerDiv.offsetWidth;
342380
if (w===0 || isNaN(w)){
@@ -528,7 +566,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
528566
nextDiv = nextPanel.childNodes[0].childNodes[0];
529567

530568

531-
me.beforeChange(currDiv, nextDiv);
569+
me.beforeChange(currDiv, nextDiv, "next");
532570

533571
var onChange = function(){
534572
me.onChange(nextDiv, currDiv);
@@ -574,7 +612,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
574612

575613
nextDiv = clone.childNodes[0].childNodes[0];
576614

577-
me.beforeChange(currDiv, nextDiv);
615+
me.beforeChange(currDiv, nextDiv, "next");
578616

579617
var onChange = function(){
580618
innerDiv.style.left = start + "px";
@@ -682,7 +720,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
682720

683721
nextDiv = nextPanel.childNodes[0].childNodes[0];
684722

685-
me.beforeChange(currDiv, nextDiv);
723+
me.beforeChange(currDiv, nextDiv, "back");
686724

687725
var onChange = function(){
688726
me.onChange(nextDiv, currDiv);
@@ -729,7 +767,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
729767

730768
nextDiv = clone.childNodes[0].childNodes[0];
731769

732-
me.beforeChange(currDiv, nextDiv);
770+
me.beforeChange(currDiv, nextDiv, "back");
733771

734772
var onChange = function(){
735773
me.onChange(nextDiv, currDiv);
@@ -801,8 +839,9 @@ javaxt.dhtml.Carousel = function(parent, config) {
801839
/** Called before the carousel switches panels.
802840
* @param currPanel Content of the active panel
803841
* @param prevPanel Content of the next active panel
842+
* @param direction "back" or "next"
804843
*/
805-
this.beforeChange = function(currPanel, nextPanel){};
844+
this.beforeChange = function(currPanel, nextPanel, direction){};
806845

807846

808847
//**************************************************************************

src/combobox/ComboBox.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ javaxt.dhtml.ComboBox = function(parent, config) {
199199

200200
//Create main div
201201
var mainDiv = createElement("div", parent);
202-
mainDiv.setAttribute("desc", me.className);
202+
mainDiv.className = "javaxt-combobox";
203203
mainDiv.style.width = config.style.width;
204204
mainDiv.style.position = "relative";
205205
me.el = mainDiv;
@@ -501,6 +501,7 @@ javaxt.dhtml.ComboBox = function(parent, config) {
501501
* dropdown menu.
502502
*/
503503
this.reset = function(){
504+
me.hideMenu();
504505

505506
//Remove everything that's not an input
506507
var a = [];
@@ -515,7 +516,8 @@ javaxt.dhtml.ComboBox = function(parent, config) {
515516

516517
//Ensure the input is visible
517518
input.show();
518-
519+
520+
input.blur();
519521
};
520522

521523

0 commit comments

Comments
 (0)