Skip to content

Commit

Permalink
remove conflict for dialog.js
Browse files Browse the repository at this point in the history
  • Loading branch information
olton committed May 29, 2013
2 parents af2bc23 + 0566127 commit 0041d5f
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 17 deletions.
11 changes: 11 additions & 0 deletions javascript/contextmenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$(function(){
$(".contextmenu").hide();
$(document).on("contextmenu", function(event) {
event.preventDefault();
$(".contextmenu")
.show()
.css({top: event.pageY + "px", left: event.pageX + "px"});
}).on("click", function(event) {
$(".contextmenu").hide();
});
});
6 changes: 3 additions & 3 deletions javascript/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@
buttons.eq(i++).click(function() {
// Calling function and close the dialog

obj.action();
if(!params.keepOpened) {
var result = obj.action();
if(!params.keepOpened || result != false) {
$.Dialog.close();
return false;
}
return false;
});
});
}
Expand Down
29 changes: 29 additions & 0 deletions less/contextmenu.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.contextmenu {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index:1000;
position: absolute;
background-color:#FFFFFF;
border-radius:2px;
border: 2.5px solid rgb(42,42,42);
padding: 2px;
}
.item:active {
background-color:rgb(0,0,0);
color:rgb(255,255,255);
}
.item:hover {
background-color:rgb(222,222,222);
}
.item {
background-color:#FFFFFF;
padding-right:50px;
padding-left:5px;
width:auto;
padding: 12px;
margin:-2px;
}
5 changes: 5 additions & 0 deletions less/forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
.input-control > input[type=email],
.input-control > input[type=url],
.input-control > input[type=phone],
.input-control > input[type=tel],
.input-control > input[type=password],
.input-control > input[type=number],
.input-control > input[type=time],
Expand Down Expand Up @@ -308,6 +309,7 @@
.input-control > input[type=email]::-ms-clear,
.input-control > input[type=url]::-ms-clear,
.input-control > input[type=phone]::-ms-clear,
.input-control > input[type=tel]::-ms-clear,
.input-control > input[type=number]::-ms-clear,
.input-control > input[type=time]::-ms-clear {
display: none;
Expand All @@ -331,6 +333,7 @@
input[type=password]:not(:focus),
input[type=email]:not(:focus),
input[type=phone]:not(:focus),
input[type=tel]:not(:focus),
input[type=number]:not(:focus),
input[type=time]:not(:focus),
input[type=url]:not(:focus) {
Expand All @@ -343,6 +346,7 @@
input[type=password]:focus,
input[type=email]:focus,
input[type=phone]:focus,
input[type=tel]:focus,
input[type=number]:focus,
input[type=time]:focus,
input[type=url]:focus {
Expand All @@ -356,6 +360,7 @@
input[type=password]:not(:focus),
input[type=email]:not(:focus),
input[type=phone]:not(:focus),
input[type=tel]:not(:focus),
input[type=number]:not(:focus),
input[type=time]:not(:focus),
input[type=url]:not(:focus) {
Expand Down
11 changes: 1 addition & 10 deletions less/layout.less
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/*
* Metro UI CSS
* (c) 2012-2013 by Sergey Pimenov
* Licensed under the MIT License and Commercial
*
* Layout.less
*
*/

*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
Expand Down Expand Up @@ -48,7 +39,7 @@
height: 100%;
min-height: 100%;
width: 100%;
.clearfix();
.clearfix;

.page-header {
width: 100%;
Expand Down
3 changes: 2 additions & 1 deletion less/modern.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@import "reset.less";

.metrouicss {
@import "typography.less";
@import "routines.less";
@import "typography.less";
@import "icons.less";
@import "colors.less";
@import "bricks.less";
Expand All @@ -35,4 +35,5 @@
@import "slider.less";
@import "dialog.less";
@import "calendar.less";
@import "contextmenu.less";
}
4 changes: 4 additions & 0 deletions public/css/modern.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/js/modern/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@
buttons.eq(i++).click(function() {
// Calling function and close the dialog

obj.action();
if(!params.keepOpened) {
var result = obj.action();
if(!params.keepOpened || result != false) {
$.Dialog.close();
return false;
}
return false;
});
});
}
Expand Down

0 comments on commit 0041d5f

Please sign in to comment.