Skip to content

Commit

Permalink
Rework mainstay dialog to be responsive, resizeable and able to drag. (
Browse files Browse the repository at this point in the history
…#1186)

* Rework mainstay dialog to be responsive, resizable and able to drag.
  • Loading branch information
sjpadgett authored and bradymiller committed Nov 14, 2017
1 parent af4f15a commit e0c2439
Show file tree
Hide file tree
Showing 12 changed files with 420 additions and 174 deletions.
1 change: 1 addition & 0 deletions interface/main/calendar/add_edit_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ function setEventDate($start_date, $recurrence)
}

?>
<!DOCTYPE html>
<html>
<head>
<?php html_header_show(); ?>
Expand Down
1 change: 1 addition & 0 deletions interface/main/calendar/find_appt_popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function doOneDay($catid, $udate, $starttime, $duration, $prefcatid)
// after this page is loaded.
}
?>
<!DOCTYPE html>
<html>
<head>
<?php html_header_show(); ?>
Expand Down
2 changes: 1 addition & 1 deletion interface/main/finder/patient_select.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$from_page = isset($_REQUEST['from_page']) ? $_REQUEST['from_page'] : "";

?>

<!DOCTYPE html>
<html>
<head>
<?php html_header_show();?>
Expand Down
29 changes: 15 additions & 14 deletions interface/main/tabs/js/include_opener.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ if(top.tab_mode===true)
}

window.close=
function()
{
var dialogDiv=top.$("#dialogDiv");
var frameName=window.name
var body=top.$("body");
var removeFrame=body.find("iframe[name='"+frameName+"']");
removeFrame.remove();
var removeDiv=body.find("div.dialogIframe[name='"+frameName+"']");
removeDiv.remove();
if(body.children("div.dialogIframe").length===0)
{
dialogDiv.hide();
};
};
function () {
var dialogDiv = top.$("#dialogDiv");
var frameName = window.name;
var dialogModal = top.$('div#'+frameName); // This is a dynamic div.
var body = top.$("body");
var removeFrame = body.find("iframe[name='" + frameName + "']");
removeFrame.remove();
if (body.children("div.dialogIframe").length === 0) {
dialogDiv.hide();
};
if (dialogModal.length > 0) { // Will let modal's hidden event clean up.
dialogModal.modal('hide');
};

};
}
2 changes: 1 addition & 1 deletion interface/main/tabs/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function isEncounterLocked( encounterId ) {
var webroot_url="<?php echo $web_root; ?>";
</script>

<?php Header::setupHeader(["knockout","tabs-theme"]); ?>
<?php Header::setupHeader(["knockout","tabs-theme",'jquery-ui']); ?>


<link rel="shortcut icon" href="<?php echo $GLOBALS['images_static_relative']; ?>/favicon.ico" />
Expand Down
1 change: 1 addition & 0 deletions interface/patient_file/encounter/find_code_dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// For what == groups
$layout_id = empty($_GET['layout_id']) ? '' : $_GET['layout_id'];
?>
<!DOCTYPE html>
<html>
<head>
<?php html_header_show(); ?>
Expand Down
33 changes: 14 additions & 19 deletions interface/super/edit_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ function writeFieldLine($linedata)

<head>

<?php Header::setupHeader(['select2','emodal']); ?>
<?php Header::setupHeader(['select2']); ?>

<title><?php xl('Layout Editor', 'e'); ?></title>

Expand Down Expand Up @@ -1191,8 +1191,9 @@ function cidChanged(lino, seq) {

// This invokes the popup to edit layout properties or add a new layout.
function edit_layout_props(groupid) {
var title = "<?php echo xlt('Layout Properties');?>";
dlgopen('edit_layout_props.php?layout_id=<?php echo attr($layout_id); ?>&group_id=' + groupid,
'_blank', 700, 550);
'_blank', 775, 550, "", title);
}

// callback from edit_layout_props.php:
Expand Down Expand Up @@ -2016,16 +2017,17 @@ function getNextSeq(group) {

// show the popup choice of lists
var ShowLists = function(btnObj) {
window.open('../patient_file/encounter/find_code_dynamic.php?what=lists',
'lists', 'width=700,height=600,scrollbars=yes');
var title = "<?php echo xla('Select List');?>";
dlgopen('../patient_file/encounter/find_code_dynamic.php?what=lists',"_blank", 850, 750, "", title);
selectedfield = btnObj;
};

// show the popup choice of groups
var ShowGroups = function(btnObj) {
if (!myChangeCheck()) return;
window.open('../patient_file/encounter/find_code_dynamic.php?what=groups&layout_id=<?php echo addslashes($layout_id); ?>',
'groups', 'width=700,height=600,scrollbars=yes');
var title = "<?php echo xlt('Select Group');?>";
dlgopen('../patient_file/encounter/find_code_dynamic.php?what=groups&layout_id=<?php echo addslashes($layout_id); ?>',
"_blank",850, 600,"", title);
};

// Show context DD for NationNotes
Expand Down Expand Up @@ -2077,17 +2079,9 @@ function layoutLook(){
var form = "<?php echo attr($layout_id);?>";
var btnName = "<?php echo xla('Back To Editor');?>";
var url = "../patient_file/encounter/view_form.php?isShow&id=0&formname=" + form;
var title = "<?php echo xla('LBF Encounter Form Preview');?>";
eModal.setEModalOptions({
loadingHtml: '<span class="fa fa-circle-o-notch fa-spin fa-3x text-primary"></span><h4><?php echo xla('Loading Form');?></h4>'
});
var params = {
buttons: [{ text: btnName, style: 'success btn-md', close:true}],
size: eModal.size.xl,
title: title,
url: url
};
return eModal.iframe(params);
var title = "<?php echo xlt('LBF Encounter Form Preview');?>";
dlgopen(url, '_blank', 1250, 800, "", title);
return false;
}

function NationNotesContext(lineitem, val) {
Expand Down Expand Up @@ -2136,8 +2130,9 @@ function FieldIDClicked(elem) {
// If the field ID is for the local form, allow direct entry.
if (srcval == 'F') return;
// Otherwise pop up the selection window.
window.open('../patient_file/encounter/find_code_dynamic.php?what=fields&source='
+ srcval, 'fields', 'width=700,height=600,scrollbars=yes');
var title = "<?php echo xlt('Select Field');?>";
dlgopen('../patient_file/encounter/find_code_dynamic.php?what=fields&source='
+ srcval, "_blank", 700, 600, "", title);
<?php } ?>
}

Expand Down
2 changes: 1 addition & 1 deletion interface/super/edit_layout_props.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function get_related() {
<?php echo xlt('Access Control'); ?>
</td>
<td>
<select name='form_aco'>
<select name='form_aco' style='width:100%'>
<option value=''></option>
<?php
$gacl = new gacl_api();
Expand Down
61 changes: 61 additions & 0 deletions interface/themes/tabs_style_compact.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,67 @@ body
display:block;
}

.ui-draggable:hover {
cursor: move;
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}

.ui-draggable:active {
cursor: move;
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
.ui-icon-gripsmall-diagonal-se {
background-position: -64px -224px;
}
.ui-icon, .ui-widget-content .ui-icon {
background-image: url("../../public/assets/jquery-ui-1-12-1/themes/sunny/images/ui-icons_d19405_256x240.png");
}
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon {
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}

#dialogDiv
{
margin: 0;
Expand Down
61 changes: 61 additions & 0 deletions interface/themes/tabs_style_full.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,67 @@ body
display:block;
}

.ui-draggable:hover {
cursor: move;
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}

.ui-draggable:active {
cursor: move;
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
.ui-icon-gripsmall-diagonal-se {
background-position: -64px -224px;
}
.ui-icon, .ui-widget-content .ui-icon {
background-image: url("../../public/assets/jquery-ui-1-12-1/themes/sunny/images/ui-icons_d19405_256x240.png");
}
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon {
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}

#dialogDiv
{
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion interface/usergroup/addrbook_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class='btn btn-primary' name='form_search' value='<?php echo xla("Search") ?>'/>
</div>
</div>
<div style="margin-top: 110px;" class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<table class="table table-condensed table-bordered table-striped table-hover">
<thead>
<th title='<?php echo xla('Click to view or edit'); ?>'><?php echo xlt('Organization'); ?></th>
<th><?php echo xlt('Name'); ?></th>
Expand Down
Loading

4 comments on commit e0c2439

@scorpions786
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<script type="text/javascript" src="/jquery-min-3-1-1/index.js"></script>

should be added to posting page

@bradymiller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @scorpions786 ,
Which script does this need to be added to? Do note the Header::setupHeader calls do bring in jquery 3.1.1.
-brady

@scorpions786
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah
I didn't update that page in my local version
my bad

@scorpions786
Copy link

@scorpions786 scorpions786 commented on e0c2439 Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to add it because I open the invoice details as dialog instead of new tab

Please sign in to comment.