From: Moritz Bunkus Date: Thu, 18 Apr 2013 11:42:43 +0000 (+0200) Subject: Verknüpfte Belege: JS-Code und CSS für jqModal verallgemeinert X-Git-Tag: release-3.1.0beta1~492 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a4d38233df45f80fb98c503108b40294d212653a;p=kivitendo-erp.git Verknüpfte Belege: JS-Code und CSS für jqModal verallgemeinert --- diff --git a/SL/Form.pm b/SL/Form.pm index 044d45f53..8859cae40 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -471,7 +471,7 @@ sub header { main menu list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header ui-lightness/jquery-ui - jquery-ui.custom + jquery-ui.custom jqModal ); $layout->use_javascript("$_.js") for (qw( diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 248bbb1f8..576564fe7 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -313,8 +313,6 @@ sub form_header { $form->{follow_up_trans_info} = $form->{donumber} .'('. $follow_up_vc .')'; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); - $form->header(); # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID' # und Erweiterung für Bug 1760: diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 3f67961ac..143696311 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -358,7 +358,6 @@ sub form_header { map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; $form->{jsscript} = 1; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); $form->header(); print $form->parse_html_template("ir/form_header", \%TMPL_VAR); diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index d7e99b76d..cbddde60d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -382,7 +382,6 @@ sub form_header { map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; $form->{jsscript} = 1; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); $form->header(); print $form->parse_html_template("is/form_header", \%TMPL_VAR); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 298d3326f..3dbb113d1 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -436,8 +436,6 @@ sub form_header { $form->{javascript} .= qq||; $form->{javascript} .= qq||; - $::request->layout->use_stylesheet('presenter/record/record_list.css'); - $form->header; $TMPL_VAR{HIDDENS} = [ map { name => $_, value => $form->{$_} }, diff --git a/css/kivitendo/jqModal.css b/css/kivitendo/jqModal.css new file mode 100644 index 000000000..7c8c92fd2 --- /dev/null +++ b/css/kivitendo/jqModal.css @@ -0,0 +1,37 @@ +/* the overlayed element */ +.jqModal_overlay { + position: fixed; + top: 50%; + margin-top: -250px; + height: 500px; + + left: 50%; + margin-left: -400px; + width: 800px; + + background-color: #fff; + border: 1px solid #333; + + /* CSS3 styling for latest browsers */ + box-shadow: 0 0 90px 5px #000; + -moz-box-shadow: 0 0 90px 5px #000; + -webkit-box-shadow: 0 0 90px #000; + + padding: 10px; +} + +.jqModal_overlay .overlay_content { + width: 790px; + height: 490px; + overflow: auto; +} + +.jqModal_overlay .close { + background-image: url(../../image/dialog-close.png); + position: absolute; + right: -16px; + top: -16px; + cursor: pointer; + height: 32px; + width: 32px; +} diff --git a/css/presenter/record/record_list.css b/css/presenter/record/record_list.css deleted file mode 100644 index 59ab17772..000000000 --- a/css/presenter/record/record_list.css +++ /dev/null @@ -1,37 +0,0 @@ -/* the overlayed element */ -.record_list_overlay { - position: fixed; - top: 50%; - margin-top: -250px; - height: 500px; - - left: 50%; - margin-left: -400px; - width: 800px; - - background-color: #fff; - border: 1px solid #333; - - /* CSS3 styling for latest browsers */ - box-shadow: 0 0 90px 5px #000; - -moz-box-shadow: 0 0 90px 5px #000; - -webkit-box-shadow: 0 0 90px #000; - - padding: 10px; -} - -.record_list_overlay .overlay_content { - width: 790px; - height: 490px; - overflow: auto; -} - -.record_list_overlay .close { - background-image: url(../../../image/dialog-close.png); - position: absolute; - right: -16px; - top: -16px; - cursor: pointer; - height: 32px; - width: 32px; -} diff --git a/js/common.js b/js/common.js index e40b9abfe..d2594a277 100644 --- a/js/common.js +++ b/js/common.js @@ -160,6 +160,30 @@ function focus_by_name(name){ return false; } +function open_jqm_window(params) { + params = params || { }; + var url = params.url; + var id = params.id ? params.id : 'jqm_popup_dialog'; + + if (params.data) { + var data = typeof params.data === "string" ? params.data : $.param(params.data); + url += (/\?/.exec(url) ? "&" : "?") + data; + } + + $('#' + id).remove(); + var div = $('
').hide().appendTo('body'); + var close = $('
').appendTo(div); + var content = $('
').appendTo(div); + div.jqm({ modal: true }); + div.jqmShow(); + $.ajax({ url: url, success: function(new_html) { $(content).html(new_html); } }); + $(close).click(function() { + div.jqmClose(); + }); + + return true; +} + $(document).ready(function () { // initialize all jQuery UI tab elements: $(".tabwidget").each(function(idx, element) { $(element).tabs(); }); diff --git a/js/jqModal/jqModal.js b/js/jqModal/jqModal.js index db318ffb8..db1dd9e7c 100644 --- a/js/jqModal/jqModal.js +++ b/js/jqModal/jqModal.js @@ -34,6 +34,7 @@ $.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');}; $.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');}; $.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});}; $.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});}; +$.fn.jqmClose=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t);this.remove();});}; $.jqm = { hash:{}, diff --git a/templates/webpages/presenter/record/grouped_record_list.html b/templates/webpages/presenter/record/grouped_record_list.html index 82c16f35c..9602388cf 100644 --- a/templates/webpages/presenter/record/grouped_record_list.html +++ b/templates/webpages/presenter/record/grouped_record_list.html @@ -17,25 +17,14 @@