Skip to content

Commit

Permalink
Item12192: don't use $(".jqButton").show() on a display:none button a…
Browse files Browse the repository at this point in the history
…s jquery will happily make it a display:inline

instead of a display:inline-block. Adding/removing a .foswikiHidden class now instead.



git-svn-id: http://svn.foswiki.org/trunk/TopicInteractionPlugin@15786 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Oct 30, 2012
1 parent 1436682 commit 66d23ef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pub/System/TopicInteractionPlugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FOSWIKI_ROOT?=~/foswiki/trunk/core
TARGET= \
metadata.js \
metadata.css \
metadata.pattern.css \
gears.init.js \
browserplus.init.js \
plupload.browserplus.js \
Expand All @@ -13,7 +12,8 @@ TARGET= \
plupload.silverlight.js \
plupload.js \
jquery.uploader.js \
jquery.uploader.css
jquery.uploader.css \
jquery.natedit.insertattachment.js

SUBDIRS=i18n

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
color: #777;
}

.jqUploaderStop,
.jqUploaderMessage {
display:none;
}
27 changes: 18 additions & 9 deletions pub/System/TopicInteractionPlugin/jquery.uploader.uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
if (!autoStartBox.is(".foswikiHidden")) {
if (typeof(foswiki.Pref) !== 'undefined' && foswiki.Pref.getPref("UPLOADER::AUTOSTART")== "true") {
autoStartBox.attr("checked", "checked");
startButton.hide();
//startButton.hide();
startButton.addClass("foswikiHidden");
} else {
autoStartBox.removeAttr("checked");
}
Expand All @@ -59,9 +60,11 @@
foswiki.Pref.setPref("UPLOADER::AUTOSTART", autoStart?"true":"false");
autoStartBox.blur();
if (autoStart) {
startButton.hide();
//startButton.hide();
startButton.addClass("foswikiHidden");
} else {
startButton.show();
//startButton.show();
startButton.removeClass("foswikiHidden");
}
});

Expand Down Expand Up @@ -374,9 +377,11 @@
}
}

stopButton.hide();
//stopButton.hide();
stopButton.addClass("foswikiHidden");
if (!autoStartBox.is(":checked")) {
startButton.show();
//startButton.show();
startButton.removeClass("foswikiHidden");
}

} else if (uploader.state === plupload.STARTED) {
Expand Down Expand Up @@ -479,8 +484,10 @@
if (nrFiles) {
if (!$(this).is("plupload_disabled")) {
$.log("UPLOADER: starting ...");
startButton.hide();
stopButton.show();
//startButton.hide();
//stopButton.show();
startButton.addClass("foswikiHidden");
stopButton.removeClass("foswikiHidden");
uploader.start();
}
} else {
Expand All @@ -493,9 +500,11 @@
$.log("UPLOADER: got Stop event");
stopClicked = true;
if (!autoStartBox.is(":checked")) {
startButton.show();
//startButton.show();
startButton.removeClass("foswikiHidden");
}
stopButton.hide();
//stopButton.hide();
stopButton.addClass("foswikiHidden");
$.each(uploader.files, function(i, file) {
if(file.status == plupload.UPLOADING) {
$.log("UPLOADER: ... setting file "+file.name+" to FAILED");
Expand Down
2 changes: 1 addition & 1 deletion templates/metadata.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@

%TMPL:DEF{"uploadform::buttonsstep::startbutton"}%%BUTTON{"%MAKETEXT{"Start upload"}%" icon="tick" class="jqUploaderStart"}%%TMPL:END%
%TMPL:DEF{"uploadform::buttonsstep::addbutton"}%%BUTTON{"%MAKETEXT{"Choose files"}%" icon="folder" class="jqUploaderBrowse"}%%TMPL:END%
%TMPL:DEF{"uploadform::buttonsstep::cancelbutton"}%%BUTTON{"%MAKETEXT{"Cancel upload"}%" icon="cross" class="jqUploaderStop"}%%TMPL:END%
%TMPL:DEF{"uploadform::buttonsstep::cancelbutton"}%%BUTTON{"%MAKETEXT{"Cancel upload"}%" icon="cross" class="jqUploaderStop foswikiHidden"}%%TMPL:END%

%TMPL:DEF{"uploadform::buttonsstep::autostart"}%<!-- -->
<input type="checkbox" class="foswikiCheckbox jqUploaderAutoStart foswikiHidden" checked name="autostart" />
Expand Down

0 comments on commit 66d23ef

Please sign in to comment.