Skip to content

1.0.9 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 30, 2025
2 changes: 1 addition & 1 deletion LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2006-2024, Peter Borissow
Copyright (c) 2006-2025, Peter Borissow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ javaxt.dhtml.Button = function(parent, config) {

//Create outer div used to hold the button, mask, and menu
var outerDiv = createElement('div', parent);
outerDiv.setAttribute("desc", me.className);
outerDiv.className = "javaxt-button";
outerDiv.style.display = config.display;
if (config.width){
if (typeof config.width === "string"){
Expand Down
51 changes: 45 additions & 6 deletions src/carousel/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,42 @@ if(!javaxt.dhtml) javaxt.dhtml={};
* can cycle through the panels using the back() and next() functions. The
* carousel can store a fixed set of panels or you can create the illusion
* of having infinite panels by updating panels when they are out of view.
* Example:
<pre>
var carousel = new javaxt.dhtml.Carousel(parent,{
loop: true,
animate: true
});
</pre>
* Once the carousel is instantiated you can call any of the public methods.
* The first thing to do is to add panels. Example:
<pre>
var p1 = document.createElement('div');
p1.style.background = "#f0f8ff";
p1.style.height = "100%";
carousel.add(p1);

var p2 = document.createElement('div');
p2.style.background = "#96a5b2";
p2.style.height = "100%";
carousel.add(p2);

var p3 = document.createElement('div');
p3.style.background = "#ffd8d6";
p3.style.height = "100%";
carousel.add(p3);
</pre>
* After panels have been added to the carousel, you can call the back() and
* next() methods to switch panels. Typically these methods are called from
* "onclick" events fired from other DOM elements (e.g. button).
*
* Finally, you can also add event listeners by overriding any of the public
* "on" or "before" methods like this:
<pre>
carousel.onChange = function(currPanel, prevPanel){
console.log("currPanel", currPanel);
};
</pre>
*
******************************************************************************/

Expand Down Expand Up @@ -140,7 +176,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
height: "100%",
position: "relative"
});
outerDiv.setAttribute("desc", me.className);
outerDiv.className = "javaxt-carousel";
me.el = outerDiv;


Expand Down Expand Up @@ -337,6 +373,8 @@ javaxt.dhtml.Carousel = function(parent, config) {
//**************************************************************************
//** resize
//**************************************************************************
/** Used to force the component to resize to fit the parent container
*/
this.resize = function(){
var w = outerDiv.offsetWidth;
if (w===0 || isNaN(w)){
Expand Down Expand Up @@ -528,7 +566,7 @@ javaxt.dhtml.Carousel = function(parent, config) {
nextDiv = nextPanel.childNodes[0].childNodes[0];


me.beforeChange(currDiv, nextDiv);
me.beforeChange(currDiv, nextDiv, "next");

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

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

me.beforeChange(currDiv, nextDiv);
me.beforeChange(currDiv, nextDiv, "next");

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

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

me.beforeChange(currDiv, nextDiv);
me.beforeChange(currDiv, nextDiv, "back");

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

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

me.beforeChange(currDiv, nextDiv);
me.beforeChange(currDiv, nextDiv, "back");

var onChange = function(){
me.onChange(nextDiv, currDiv);
Expand Down Expand Up @@ -801,8 +839,9 @@ javaxt.dhtml.Carousel = function(parent, config) {
/** Called before the carousel switches panels.
* @param currPanel Content of the active panel
* @param prevPanel Content of the next active panel
* @param direction "back" or "next"
*/
this.beforeChange = function(currPanel, nextPanel){};
this.beforeChange = function(currPanel, nextPanel, direction){};


//**************************************************************************
Expand Down
6 changes: 4 additions & 2 deletions src/combobox/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ javaxt.dhtml.ComboBox = function(parent, config) {

//Create main div
var mainDiv = createElement("div", parent);
mainDiv.setAttribute("desc", me.className);
mainDiv.className = "javaxt-combobox";
mainDiv.style.width = config.style.width;
mainDiv.style.position = "relative";
me.el = mainDiv;
Expand Down Expand Up @@ -501,6 +501,7 @@ javaxt.dhtml.ComboBox = function(parent, config) {
* dropdown menu.
*/
this.reset = function(){
me.hideMenu();

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

//Ensure the input is visible
input.show();


input.blur();
};


Expand Down
Loading