Commit a37a72da authored by theo lem's avatar theo lem
Browse files

Merge branch 'fix-51' into 'master'

Fix 51

See merge request framasoft/framaforms!21
parent 7132b8bd
......@@ -128,6 +128,7 @@ textarea,
select,
a.button {
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
max-width: 100%;
}
/* ------------------ Reset Styles ------------------ */
......@@ -1127,6 +1128,8 @@ fieldset {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
min-width:100%;
}
.fieldset-wrapper {
margin-top: 25px;
......@@ -1639,3 +1642,45 @@ div.admin-panel .description {
#footer-wrapper .poll .bar .foreground {
background-color: #ddd;
}
/* --------- Modification : responsive table element */
/* ---- Taken from https://css-tricks.com/responsive-data-tables/ */
@media
only screen and (max-width: 1024px),
(min-device-width: 768px) and (max-device-width:1024px) {
/* Force table not to be tables anymore */
table, thread, tbody, th, td, tr {
display: block;
}
.th.checkbox.webform-grid-option{
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
}
/* Make some options disappear in the admin menu of webforms*/
.vertical-tabs{
display: none;
}
.region-sidebar-first{
display: none;
}
}
......@@ -13,7 +13,6 @@ stylesheets[all][] = css/colors.css
stylesheets[print][] = css/print.css
scripts[] = js/framaforms.js
scripts[] = js/responsive_progress_bar.js
regions[header] = Header
regions[help] = Help
......
(function($) {
jQuery(function($){
Drupal.node_edit_protection = {};
var click = false; // Allow Submit/Edit button
var edit = false; // Dirty form flag
......@@ -51,4 +51,18 @@
}
}
};
})(jQuery);
/* Get progress bar title and replace progress bar with the title of the current page
* for mobiles.
*/
if(window.screen.width < 768 || window.screen.height < 1024){
// get current and last page numbers
var currentPage = $(".webform-progressbar-page.current > .webform-progressbar-page-number").text();
var lastPage = $(".webform-progressbar-page-number:last").text();
var currentTitle = $(".webform-progressbar-page.current > .webform-progressbar-page-label").text();
// Replace progress bar with textual element
$(".webform-progressbar")
.replaceWith("<h4>"+ currentTitle + ": " + currentPage + " / " + lastPage + "</h5>");
}
});
function responsive_progress_bar() {
if(window.screen.width < 768 || window.screen.height < 1024) {
var divnode = document.createElement("h5");
// get current page number
var current_pos = document
.querySelector(".webform-progressbar-page.current")
.querySelector(".webform-progressbar-page-number")
.innerText;
// get total number of titles
var total_number_of_titles = document
.getElementsByClassName("webform-progressbar-page-number")
.length;
divnode.innerHTML = "Étape " + current_pos + " / " + total_number_of_titles + " - "
+ document.querySelector(".webform-progressbar-page.current")
.querySelector(".webform-progressbar-page-label")
.innerText ;
document.getElementById("page-title").appendChild(divnode);
document.querySelector(".webform-progressbar-outer").style.display="none";
}
}
window.onload = responsive_progress_bar;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment