Skip to content
Snippets Groups Projects
Commit 3c13286a authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed some minor UI issues

parent 94d28387
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ nav {
right: 0;
top: 0;
height: 56px;
z-index: 1;
z-index: 2;
}
nav .wrapper {
......@@ -159,7 +159,7 @@ nav input[type=text] {
}
#no_more img {
margin: 8rem auto 0px;
margin: 8rem auto 0;
display: block;
}
......@@ -174,7 +174,7 @@ nav input[type=text] {
inline-button {
display: block;
background: rgb(255, 255, 255) none repeat scroll 0% 0%;
background: rgb(255, 255, 255) none repeat scroll 0 0;
font-size: 16px;
height: 48px;
line-height: 48px;
......
......@@ -20,12 +20,8 @@ var get_history = function () {
var wrap_click_handler = function (fun) {
return function (event) {
var sel = getSelection().toString();
if (sel) {
event.stopPropagation();
} else if (fun) {
fun(event);
}
event.stopPropagation();
fun(event);
}
};
......@@ -52,14 +48,6 @@ $("#q").keypress(function (e) {
}
});
$("body").click(function (e) {
open[open.length-1](e);
});
$("nav").click(function (e) {
e.stopPropagation();
});
$("#q").focus(function (){
$("#autocomplete").addClass("active");
$("#results").addClass("hidden");
......@@ -175,7 +163,9 @@ var attach_buffer = function (elem) {
e.stopPropagation();
}));
buffers[id].contexts.forEach(function (context) {
attach_context(elem.find("#context" + context.id));
var context = elem.find("#context" + context.id);
if (context.length)
attach_context(context);
})
};
......@@ -239,6 +229,10 @@ var attach_context = function (elem) {
elem.unbind();
var id = elem.data("contextid");
var bufferid = elem.data("bufferid");
if (buffers[bufferid] === undefined) {
console.log("Undefined buffer: " + bufferid);
}
elem.click(wrap_click_handler(function (e) {e.stopPropagation(); }));
$("#message"+buffers[bufferid].contexts[id].original.messageid).click(wrap_click_handler(make_toggle_context(bufferid, id)));
elem.find(".load_before").click(wrap_click_handler(function (e) {
......@@ -393,6 +387,7 @@ var make_toggle_buffer = function (id) {
var select_buffer = function (id) {
deselect_buffers(id);
open.push(make_toggle_buffer(id));
buffers[id].selected = true;
update_buffer(id);
};
......@@ -411,9 +406,10 @@ var make_toggle_context = function (buffer, id) {
open.pop();
} else {
unselect_contexts(buffer);
if (!buffers[buffer].selected)
if (!buffers[buffer].selected) {
open.push(make_toggle_buffer(buffer));
buffers[buffer].selected = true;
buffers[buffer].selected = true;
}
context.selected = true;
open.push(make_toggle_context(buffer, id));
if (context.before.length === 0) earlier(buffer, id, 5);
......@@ -462,4 +458,15 @@ var sort_messages = function (arr) {
});
};
update_history();
\ No newline at end of file
update_history();
$("body").click(function (e) {
if (open.length)
open[open.length - 1](e);
});
$("nav").click(function (e) {
e.stopPropagation();
});
\ No newline at end of file
......@@ -29,6 +29,7 @@
</section>
<div id="modal-background"></div>
<div id="bg"></div>
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="res/search.js"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment