From 912ada3e07eae319b7c8baaa6abf25d30c47c0fb Mon Sep 17 00:00:00 2001 From: Ignacio del Valle Alles Date: Thu, 17 Mar 2016 17:09:11 +0100 Subject: [PATCH] --- dist/js/brutusin-json-forms-bootstrap.js | 3 ++- dist/js/brutusin-json-forms-bootstrap.min.js | 2 +- src/js/brutusin-json-forms-bootstrap.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/js/brutusin-json-forms-bootstrap.js b/dist/js/brutusin-json-forms-bootstrap.js index b1b3f2c..b29e630 100644 --- a/dist/js/brutusin-json-forms-bootstrap.js +++ b/dist/js/brutusin-json-forms-bootstrap.js @@ -138,7 +138,7 @@ if (("undefined" === typeof $ || "undefined" === typeof $.fn || "undefined" === table.setAttribute("style", "border:none;margin:0"); var tr = document.createElement("tr"); var td1 = document.createElement("td"); - td1.setAttribute("style", "width:100%"); + td1.setAttribute("style", "width:100%; padding:0;padding-right:4px"); table.appendChild(tr); tr.appendChild(td1); parent.removeChild(element); @@ -146,6 +146,7 @@ if (("undefined" === typeof $ || "undefined" === typeof $.fn || "undefined" === parent.appendChild(table); var td = document.createElement("td"); tr.appendChild(td); + td.setAttribute("style", "padding:0"); var searchButton = document.createElement("button"); searchButton.className = "btn btn-default glyphicon " + glyphicon; searchButton.onclick = function () { diff --git a/dist/js/brutusin-json-forms-bootstrap.min.js b/dist/js/brutusin-json-forms-bootstrap.min.js index e051956..487f8bf 100644 --- a/dist/js/brutusin-json-forms-bootstrap.min.js +++ b/dist/js/brutusin-json-forms-bootstrap.min.js @@ -1 +1 @@ -if("undefined"==typeof brutusin||"undefined"==typeof brutusin["json-forms"])throw new Error("brutusin-json-forms-bootstrap.js requires brutusin-json-forms.js");"undefined"==typeof markdown&&window.console&&console.warn("Include markdown.js (https://github.com/evilstreak/markdown-js) to add markdown support in property description popups"),"undefined"!=typeof $&&"undefined"!=typeof $.fn&&"undefined"!=typeof $.fn.selectpicker||!window.console||console.warn("Include bootstrap-select.js (https://github.com/silviomoreto/bootstrap-select) to turn native selects into bootstrap components"),function(){var e=brutusin["json-forms"];e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();if("input"===o&&"checkbox"!==e.type||"textarea"===o)e.className+=" form-control";else if("select"===o)e.className+=" chosen-select form-control";else if("button"===o){if("remove"===e.className)for(e.className+=" glyphicon glyphicon-remove";e.firstChild;)e.removeChild(e.firstChild);e.className+=" btn btn-primary btn-xs"}else"form"===o&&(e.className+=" form-inline")}}),e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();if(("label"===o||"button"===o)&&e.title){var n=document.createElement("a");n.setAttribute("style","outline: 0; text-decoration: none; margin-left: 2px;"),n.setAttribute("tabIndex",-1),n.className="glyphicon glyphicon-info-sign",n.setAttribute("data-toggle","popover"),n.setAttribute("data-trigger","focus"),"undefined"==typeof markdown?n.setAttribute("data-content",e.title):n.setAttribute("data-content",markdown.toHTML(e.title)),t.title?n.title=t.title:n.title="Help",$(n).popover({placement:"top",container:"body",html:!("undefined"==typeof markdown)}),e.parentNode.appendChild(n)}}}),e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();"undefined"!=typeof $&&"undefined"!=typeof $.fn&&"undefined"!=typeof $.fn.selectpicker&&"select"===o&&(e.title="",e.className+=" selectpicker",e.setAttribute("data-live-search",!0),$(e).selectpicker())}}),e.bootstrap=new Object,e.bootstrap.addFormatDecorator=function(t,o,n,a){e.addDecorator(function(e,i){if(e.tagName){var r=e.tagName.toLowerCase();if("input"===r&&"string"===i.type&&i.format===t&&(o&&(e.type=o),n)){var d=e.parentNode,s=document.createElement("table");s.setAttribute("style","border:none;margin:0");var l=document.createElement("tr"),c=document.createElement("td");c.setAttribute("style","width:100%"),s.appendChild(l),l.appendChild(c),d.removeChild(e),c.appendChild(e),d.appendChild(s);var p=document.createElement("td");l.appendChild(p);var u=document.createElement("button");u.className="btn btn-default glyphicon "+n,u.onclick=function(){a(e)},p.appendChild(u)}}})},e.bootstrap.showLoading=function(e){if(e&&e.parentNode){var t=e.id+"_loading",o=e.id+"_loading-layer",n=document.getElementById(t),a=document.getElementById(o);if(!n){var i=e.tagName.toLowerCase();e.parentNode.style.position="relative",n=document.createElement("span"),n.id=t,n.className="glyphicon glyphicon-refresh glyphicon-refresh-animate","select"===i?n.className+=" loading-icon-select":"checkbox"===e.type?n.className+=" loading-icon-checkbox":n.className+=" loading-icon",e.parentNode.appendChild(n),a=document.createElement("div"),a.className="loading-layer",a.appendChild(document.createTextNode("")),a.id=o,e.parentNode.appendChild(a)}n.style.visibility="visible",a.style.visibility="visible"}},e.bootstrap.hideLoading=function(e){if(e){var t=e.id+"_loading",o=e.id+"_loading-layer",n=document.getElementById(t),a=document.getElementById(o);n&&(n.style.visibility="hidden"),a&&(a.style.visibility="hidden")}},e.onResolutionStarted=e.bootstrap.showLoading,e.onResolutionFinished=e.bootstrap.hideLoading,e.onValidationSuccess=function(e){e.parentNode.className=e.parentNode.className.replace(" has-error","")},e.onValidationError=function(t,o){setTimeout(function(){var n=t.getAttribute("data-toggle"),a=t.getAttribute("data-trigger"),i=t.getAttribute("data-content"),r=t.title;t.setAttribute("data-toggle","popover"),t.setAttribute("data-trigger","manual"),"undefined"==typeof markdown?t.setAttribute("data-content",o):t.setAttribute("data-content",markdown.toHTML(o)),t.title=e.messages.validationError,t.parentNode.className.includes("has-error")||(t.parentNode.className+=" has-error"),t.focus(),$(t).popover({placement:"top",container:"body",html:!0}),$(t).popover("show");var d=t.onblur;t.onblur=function(e){n?($(t).popover("hide"),t.setAttribute("data-toggle",n),t.setAttribute("data-trigger",a),t.setAttribute("data-content",i)):($(t).popover("destroy"),t.removeAttribute("data-toggle"),t.removeAttribute("data-trigger"),t.removeAttribute("data-content")),t.onblur=d,t.title=r,d&&d()}},200)}}(); \ No newline at end of file +if("undefined"==typeof brutusin||"undefined"==typeof brutusin["json-forms"])throw new Error("brutusin-json-forms-bootstrap.js requires brutusin-json-forms.js");"undefined"==typeof markdown&&window.console&&console.warn("Include markdown.js (https://github.com/evilstreak/markdown-js) to add markdown support in property description popups"),"undefined"!=typeof $&&"undefined"!=typeof $.fn&&"undefined"!=typeof $.fn.selectpicker||!window.console||console.warn("Include bootstrap-select.js (https://github.com/silviomoreto/bootstrap-select) to turn native selects into bootstrap components"),function(){var e=brutusin["json-forms"];e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();if("input"===o&&"checkbox"!==e.type||"textarea"===o)e.className+=" form-control";else if("select"===o)e.className+=" chosen-select form-control";else if("button"===o){if("remove"===e.className)for(e.className+=" glyphicon glyphicon-remove";e.firstChild;)e.removeChild(e.firstChild);e.className+=" btn btn-primary btn-xs"}else"form"===o&&(e.className+=" form-inline")}}),e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();if(("label"===o||"button"===o)&&e.title){var n=document.createElement("a");n.setAttribute("style","outline: 0; text-decoration: none; margin-left: 2px;"),n.setAttribute("tabIndex",-1),n.className="glyphicon glyphicon-info-sign",n.setAttribute("data-toggle","popover"),n.setAttribute("data-trigger","focus"),"undefined"==typeof markdown?n.setAttribute("data-content",e.title):n.setAttribute("data-content",markdown.toHTML(e.title)),t.title?n.title=t.title:n.title="Help",$(n).popover({placement:"top",container:"body",html:!("undefined"==typeof markdown)}),e.parentNode.appendChild(n)}}}),e.addDecorator(function(e,t){if(e.tagName){var o=e.tagName.toLowerCase();"undefined"!=typeof $&&"undefined"!=typeof $.fn&&"undefined"!=typeof $.fn.selectpicker&&"select"===o&&(e.title="",e.className+=" selectpicker",e.setAttribute("data-live-search",!0),$(e).selectpicker())}}),e.bootstrap=new Object,e.bootstrap.addFormatDecorator=function(t,o,n,a){e.addDecorator(function(e,i){if(e.tagName){var r=e.tagName.toLowerCase();if("input"===r&&"string"===i.type&&i.format===t&&(o&&(e.type=o),n)){var d=e.parentNode,s=document.createElement("table");s.setAttribute("style","border:none;margin:0");var l=document.createElement("tr"),c=document.createElement("td");c.setAttribute("style","width:100%; padding:0;padding-right:4px"),s.appendChild(l),l.appendChild(c),d.removeChild(e),c.appendChild(e),d.appendChild(s);var p=document.createElement("td");l.appendChild(p),p.setAttribute("style","padding:0");var u=document.createElement("button");u.className="btn btn-default glyphicon "+n,u.onclick=function(){a(e)},p.appendChild(u)}}})},e.bootstrap.showLoading=function(e){if(e&&e.parentNode){var t=e.id+"_loading",o=e.id+"_loading-layer",n=document.getElementById(t),a=document.getElementById(o);if(!n){var i=e.tagName.toLowerCase();e.parentNode.style.position="relative",n=document.createElement("span"),n.id=t,n.className="glyphicon glyphicon-refresh glyphicon-refresh-animate","select"===i?n.className+=" loading-icon-select":"checkbox"===e.type?n.className+=" loading-icon-checkbox":n.className+=" loading-icon",e.parentNode.appendChild(n),a=document.createElement("div"),a.className="loading-layer",a.appendChild(document.createTextNode("")),a.id=o,e.parentNode.appendChild(a)}n.style.visibility="visible",a.style.visibility="visible"}},e.bootstrap.hideLoading=function(e){if(e){var t=e.id+"_loading",o=e.id+"_loading-layer",n=document.getElementById(t),a=document.getElementById(o);n&&(n.style.visibility="hidden"),a&&(a.style.visibility="hidden")}},e.onResolutionStarted=e.bootstrap.showLoading,e.onResolutionFinished=e.bootstrap.hideLoading,e.onValidationSuccess=function(e){e.parentNode.className=e.parentNode.className.replace(" has-error","")},e.onValidationError=function(t,o){setTimeout(function(){var n=t.getAttribute("data-toggle"),a=t.getAttribute("data-trigger"),i=t.getAttribute("data-content"),r=t.title;t.setAttribute("data-toggle","popover"),t.setAttribute("data-trigger","manual"),"undefined"==typeof markdown?t.setAttribute("data-content",o):t.setAttribute("data-content",markdown.toHTML(o)),t.title=e.messages.validationError,t.parentNode.className.includes("has-error")||(t.parentNode.className+=" has-error"),t.focus(),$(t).popover({placement:"top",container:"body",html:!0}),$(t).popover("show");var d=t.onblur;t.onblur=function(e){n?($(t).popover("hide"),t.setAttribute("data-toggle",n),t.setAttribute("data-trigger",a),t.setAttribute("data-content",i)):($(t).popover("destroy"),t.removeAttribute("data-toggle"),t.removeAttribute("data-trigger"),t.removeAttribute("data-content")),t.onblur=d,t.title=r,d&&d()}},200)}}(); \ No newline at end of file diff --git a/src/js/brutusin-json-forms-bootstrap.js b/src/js/brutusin-json-forms-bootstrap.js index b1b3f2c..b29e630 100644 --- a/src/js/brutusin-json-forms-bootstrap.js +++ b/src/js/brutusin-json-forms-bootstrap.js @@ -138,7 +138,7 @@ if (("undefined" === typeof $ || "undefined" === typeof $.fn || "undefined" === table.setAttribute("style", "border:none;margin:0"); var tr = document.createElement("tr"); var td1 = document.createElement("td"); - td1.setAttribute("style", "width:100%"); + td1.setAttribute("style", "width:100%; padding:0;padding-right:4px"); table.appendChild(tr); tr.appendChild(td1); parent.removeChild(element); @@ -146,6 +146,7 @@ if (("undefined" === typeof $ || "undefined" === typeof $.fn || "undefined" === parent.appendChild(table); var td = document.createElement("td"); tr.appendChild(td); + td.setAttribute("style", "padding:0"); var searchButton = document.createElement("button"); searchButton.className = "btn btn-default glyphicon " + glyphicon; searchButton.onclick = function () {