Skip to content

Commit

Permalink
add: updates from muzamil.zaviago.com (2024-11-12)
Browse files Browse the repository at this point in the history
  • Loading branch information
umer2001 committed Nov 12, 2024
1 parent ece7a68 commit 2cb4e3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
19 changes: 1 addition & 18 deletions frappe/contacts/doctype/address/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ frappe.ui.form.on("Address", {
},
onload: function (frm) {
if (frm.doc.__islocal) {
//bymuzammal
$("header").addClass("hide");
//by muzammal
const last_doc = frappe.contacts.get_last_doc(frm);
if (
frappe.dynamic_link &&
Expand Down Expand Up @@ -98,18 +95,4 @@ frappe.ui.form.on("Address", {
},
]);
},
});
//muzammal
$(document).ready(function () {
window.addEventListener('popstate', function (event) {
show_header()
});
window.addEventListener('pushstate', function (event) {
show_header()
});
});
function show_header(){
$("header").removeClass("hide");
$("header").show();
}
//muzammal
});
6 changes: 5 additions & 1 deletion frappe/public/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,12 @@ $(document).ready(function () {
if (left_sidebar.attr("style") == "display: none;"){
left_sidebar.attr("style", "")
}

sidebar_wrapper.toggle();
if (sidebar_wrapper.attr("style") == "display: block;"){
$(".layout-main-section-wrapper").css("max-width","72%")
}else{
$(".layout-main-section-wrapper").css("max-width","100%")
}
});

var sidebar = $('#rightside');
Expand Down
8 changes: 7 additions & 1 deletion frappe/public/js/frappe/form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
var loadingFreeze = `<div id="freeze-save"></div>`
var default_tabs = headers.html();
var imageslist = $(frm.$wrapper[0]).find('.images_list').html();
let order_total='';
if( frm.doc.disable_rounded_total ){
order_total=frm.doc.grand_total
}else{
order_total=frm.doc.rounded_total
}
var creatingIcon = `<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.4991 4.73578L19.8778 1.12579L19.8707 1.13068L19.1326 0.135995C19.1075 0.101521 19.0755 0.0721519 19.0385 0.049597C19.0014 0.0270421 18.96 0.0117515 18.9167 0.00461181C18.8734 -0.00252571 18.8291 -0.00136902 18.7863 0.00801669C18.7434 0.0174002 18.703 0.0348259 18.6673 0.0592768L16.9027 1.25136C14.6563 2.78572 13.25 4.20205 12.342 5.82494C11.9158 6.58758 11.5982 7.39622 11.3782 8.29455L10.8862 8.01125C10.5891 7.3243 10.4178 6.57572 10.3526 5.7745L10.1882 3.68358C10.1806 3.59725 10.1396 3.51809 10.074 3.46324C10.0084 3.40839 9.9235 3.38226 9.83768 3.3905L5.39246 3.84968L5.39315 3.85827L4.16043 3.99843C4.11796 4.00285 4.07646 4.0158 4.03835 4.03653C4.00023 4.05726 3.96627 4.08536 3.93842 4.11919C3.91057 4.15302 3.8894 4.19191 3.87613 4.2336C3.86287 4.27528 3.85777 4.31893 3.86115 4.36201L4.01395 6.4822C4.22305 9.1897 4.74971 11.1126 5.70485 12.7083C6.15382 13.4575 6.69696 14.136 7.36669 14.775L6.87344 15.059C6.12902 14.972 5.39401 14.7458 4.66631 14.4018L2.76854 13.4984C2.68978 13.4617 2.60054 13.4576 2.52012 13.4868C2.4397 13.516 2.37457 13.5763 2.33881 13.6545L0.514909 17.7237L0.522713 17.7274L0.0280564 18.8622C0.0106581 18.9011 0.00115393 18.9435 9.87304e-05 18.9867C-0.000956607 19.03 0.00645751 19.0734 0.0219079 19.1144C0.0373601 19.1554 0.060541 19.1931 0.0901043 19.2254C0.119666 19.2577 0.15502 19.2839 0.194109 19.3025L2.11148 20.2307C4.56696 21.4038 6.49992 21.9103 8.36309 21.8832C9.23834 21.87 10.0993 21.74 10.9892 21.4809V22.0503C10.5416 22.6496 9.97778 23.1711 9.31548 23.6275L7.58216 24.815C7.51098 24.8647 7.46276 24.9397 7.44793 25.0238C7.4331 25.1078 7.45285 25.1942 7.50291 25.2642L10.1242 28.8742L10.1313 28.8693L10.8694 29.864C10.8945 29.8985 10.9265 29.9278 10.9635 29.9504C11.0006 29.973 11.042 29.9882 11.0853 29.9954C11.1286 30.0025 11.1729 30.0014 11.2158 29.992C11.2586 29.9826 11.299 29.9652 11.3347 29.9407L13.0993 28.7486C15.3457 27.2143 16.752 25.7979 17.66 24.1751C18.0862 23.4124 18.4038 22.6038 18.6238 21.7055L19.1138 21.9876C19.4109 22.6746 19.5822 23.4231 19.6474 24.2244L19.8118 26.3153C19.8194 26.4016 19.8604 26.4808 19.926 26.5356C19.9916 26.5905 20.0765 26.6166 20.1623 26.6084L24.6075 26.1492L24.6068 26.1406L25.8396 26.0004C25.882 25.996 25.9235 25.9831 25.9617 25.9623C25.9998 25.9416 26.0337 25.9135 26.0616 25.8797C26.0894 25.8458 26.1106 25.8069 26.1239 25.7653C26.1371 25.7236 26.1422 25.6799 26.1389 25.6368L25.9861 23.5166C25.7769 20.8092 25.2503 18.8863 24.2952 17.2905C23.8462 16.5413 23.303 15.8628 22.6333 15.2238L23.1266 14.9398C23.871 15.0268 24.606 15.253 25.3337 15.597L27.2315 16.5005C27.3102 16.5371 27.3995 16.5412 27.4799 16.512C27.5603 16.4828 27.6254 16.4225 27.6612 16.3443L29.4851 12.2751L29.4773 12.2714L29.9719 11.1366C29.9893 11.0977 29.9988 11.0554 29.9999 11.0121C30.001 10.9688 29.9935 10.9254 29.9781 10.8844C29.9626 10.8435 29.9395 10.8057 29.9099 10.7734C29.8803 10.7411 29.845 10.7149 29.8059 10.6963L27.8885 9.76816C25.433 8.59502 23.5001 8.08849 21.6369 8.11562C20.7623 8.12882 19.902 8.2586 19.0128 8.51733V7.94965C19.4604 7.35043 20.0242 6.82892 20.6865 6.37254L22.4199 5.18505C22.491 5.13533 22.5392 5.06032 22.5541 4.97624C22.5689 4.89217 22.5492 4.80578 22.4991 4.73578ZM13.8889 10.0321C14.1132 9.34766 14.3639 8.67642 14.4299 8.5448C14.452 8.50078 14.4884 8.41592 14.5281 8.32344C14.607 8.13941 14.6989 7.92522 14.7165 7.94274C14.7257 7.95192 14.7321 8.06635 14.7417 8.2355C14.7595 8.55137 14.7881 9.05806 14.8654 9.42663C14.9842 9.99258 15.2349 10.7033 15.4196 10.9929C16.2642 12.3353 17.729 13.3225 20.0911 14.1517C20.4322 14.2717 20.9344 14.3912 21.3502 14.4901C21.7547 14.5864 22.0774 14.6632 22.0905 14.7021C22.1148 14.7872 21.2664 14.8855 20.7832 14.9415C20.7433 14.9462 20.7059 14.9505 20.6717 14.9545C18.336 15.2309 16.8053 17.0472 15.5252 21.0483C15.5045 21.115 15.4812 21.1914 15.4566 21.272C15.3403 21.6532 15.1949 22.1302 15.1513 22.1302C15.1213 22.1302 15.0885 21.8788 15.0488 21.5747C15.0186 21.3435 14.9845 21.0819 14.9446 20.8772C14.7202 19.6137 14.3244 18.8898 13.4138 17.9948C12.5047 17.1108 11.2045 16.6958 8.94796 15.9757C8.58409 15.8595 8.19536 15.7355 7.77939 15.6002C7.47587 15.5081 8.26729 15.2835 9.20422 15.0861C10.2995 14.8492 11.2232 14.3622 11.8831 13.6515C12.6352 12.8355 13.4138 11.4272 13.8889 10.0321Z" fill="#006AFF"/>
</svg>`
var svgimgs = '<svg width="30" height="30" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="38" height="38" rx="19" fill="black"/> <circle opacity="0.4" cx="19" cy="19" r="12.047" stroke="#37C058" stroke-width="1.90596"/> <path d="M19.7049 6.91999C22.0666 7.12661 24.314 8.02892 26.1629 9.51281C28.0118 10.9967 29.3791 12.9955 30.092 15.2565C30.8049 17.5175 30.8313 19.9392 30.1679 22.2152C29.5045 24.4912 28.1811 26.5194 26.365 28.0432C24.5489 29.5671 22.3218 30.5182 19.9651 30.7763C17.6085 31.0344 15.2282 30.5879 13.1254 29.4932C11.0225 28.3985 9.29151 26.7049 8.15121 24.6264C7.01092 22.5479 6.51258 20.178 6.7192 17.8163" stroke="#37C058" stroke-width="2.5" stroke-linecap="round"/> </svg>';
var structure = '<div class="save_state"><div class="first_action"><div class="icon-creating">' + creatingIcon + '<h3>'+(action === "Submit" ? (frm.doc.is_return ? "Submitting refund order" : "Submitting order") : (frm.doc.is_return ? "Creating refund order" : "Creating order"))+'</h3></div><span>'+svgimgs+'</span></div> <div class="second_action"><div class="order_totals"> <span class="total_title">Total (THB)</span> <span class="total_value">฿ '+ frm.doc.base_grand_total.toFixed(2) +'</span> </div></div> <div class="third_action"><div class="images_list">'+imageslist+'</div></div> <div class="fourth_action"><div class="tickicon"><svg width="57" height="57" viewBox="0 0 57 57" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M28.5 56.1484C13.2695 56.1484 0.609375 43.4883 0.609375 28.2578C0.609375 13 13.2422 0.367188 28.4727 0.367188C43.7305 0.367188 56.3906 13 56.3906 28.2578C56.3906 43.4883 43.7578 56.1484 28.5 56.1484ZM28.5 51.5C41.4062 51.5 51.7695 41.1641 51.7422 28.2578C51.7148 15.3516 41.3789 5.01562 28.4727 5.01562C15.5664 5.01562 5.28516 15.3516 5.28516 28.2578C5.28516 41.1641 15.5938 51.5 28.5 51.5ZM25.4922 41.2461C24.5898 41.2461 23.8516 40.8633 23.168 39.9609L16.4961 31.7852C16.1133 31.2656 15.8672 30.6641 15.8672 30.0898C15.8672 28.8594 16.7969 27.9023 17.9727 27.9023C18.7383 27.9023 19.3398 28.1484 19.9961 29.0234L25.3828 35.9688L36.7305 17.7852C37.25 16.9648 37.9336 16.5547 38.6172 16.5547C39.7656 16.5547 40.8594 17.3477 40.8594 18.5508C40.8594 19.1523 40.5039 19.7812 40.2031 20.3008L27.707 39.9609C27.1602 40.8086 26.3945 41.2461 25.4922 41.2461Z" fill="#37C058"></path> </svg></div></div> </div>';
var structure = '<div class="save_state"><div class="first_action"><div class="icon-creating">' + creatingIcon + '<h3>'+(action === "Submit" ? (frm.doc.is_return ? "Submitting refund order" : "Submitting order") : (frm.doc.is_return ? "Creating refund order" : "Creating order"))+'</h3></div><span>'+svgimgs+'</span></div> <div class="second_action"><div class="order_totals"> <span class="total_title">Total (THB)</span> <span class="total_value">฿ '+ order_total.toFixed(2) +'</span> </div></div> <div class="third_action"><div class="images_list">'+imageslist+'</div></div> <div class="fourth_action"><div class="tickicon"><svg width="57" height="57" viewBox="0 0 57 57" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M28.5 56.1484C13.2695 56.1484 0.609375 43.4883 0.609375 28.2578C0.609375 13 13.2422 0.367188 28.4727 0.367188C43.7305 0.367188 56.3906 13 56.3906 28.2578C56.3906 43.4883 43.7578 56.1484 28.5 56.1484ZM28.5 51.5C41.4062 51.5 51.7695 41.1641 51.7422 28.2578C51.7148 15.3516 41.3789 5.01562 28.4727 5.01562C15.5664 5.01562 5.28516 15.3516 5.28516 28.2578C5.28516 41.1641 15.5938 51.5 28.5 51.5ZM25.4922 41.2461C24.5898 41.2461 23.8516 40.8633 23.168 39.9609L16.4961 31.7852C16.1133 31.2656 15.8672 30.6641 15.8672 30.0898C15.8672 28.8594 16.7969 27.9023 17.9727 27.9023C18.7383 27.9023 19.3398 28.1484 19.9961 29.0234L25.3828 35.9688L36.7305 17.7852C37.25 16.9648 37.9336 16.5547 38.6172 16.5547C39.7656 16.5547 40.8594 17.3477 40.8594 18.5508C40.8594 19.1523 40.5039 19.7812 40.2031 20.3008L27.707 39.9609C27.1602 40.8086 26.3945 41.2461 25.4922 41.2461Z" fill="#37C058"></path> </svg></div></div> </div>';
headers.html(structure);
$("#body").append(loadingFreeze)
$('body').css("overflow", "hidden")
Expand Down

0 comments on commit 2cb4e3a

Please sign in to comment.