Browse Source

style fixes

version-14
Rushabh Mehta 12 years ago
parent
commit
0cd18f5aa2
10 changed files with 39 additions and 37 deletions
  1. +1
    -1
      public/css/legacy/forms.css
  2. +6
    -8
      public/css/legacy/grid.css
  3. +3
    -2
      public/js/legacy/widgets/form/form.js
  4. +4
    -2
      public/js/legacy/widgets/form/grid.js
  5. +4
    -6
      public/js/legacy/wn/widgets/form/assign_to.js
  6. +12
    -9
      public/js/legacy/wn/widgets/form/comments.js
  7. +2
    -2
      public/js/legacy/wn/widgets/form/sidebar.js
  8. +2
    -2
      public/js/legacy/wn/widgets/page_sidebar.js
  9. +1
    -1
      public/js/wn/form/attachments.js
  10. +4
    -4
      public/js/wn/model/doclist.js

+ 1
- 1
public/css/legacy/forms.css View File

@@ -137,7 +137,7 @@ div.time_field select{
/* sidebar */

div.sidebar-comment-wrapper input {
width: 50%;
width: 70%;
}
div.sidebar-comment-message {
margin-top: 8px;


+ 6
- 8
public/css/legacy/grid.css View File

@@ -65,6 +65,12 @@ div.grid_tbarlinks {
border-bottom: 1px solid #AAA;
height: 40px;
padding: 0px;
vertical-align: middle;
font-weight: bold;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

background: #eeeeee; /* Old browsers */
background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */
@@ -76,14 +82,6 @@ div.grid_tbarlinks {
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
}

.grid_head_table td div {
color: #222;
font-weight: bold;
overflow: hidden;
padding: 2px 0px;
text-align: center;
}

.grid_selector {
padding: 1px;
border-right: 1px solid #DDD;


+ 3
- 2
public/js/legacy/widgets/form/form.js View File

@@ -793,10 +793,12 @@ _f.Frm.prototype.runclientscript = function(caller, cdt, cdn) {
try {
if(this.cscript[caller])
ret = this.cscript[caller](doc, cdt, cdn);
// for product
if(this.cscript['custom_'+caller])
ret += this.cscript['custom_'+caller](doc, cdt, cdn);
} catch(e) {
validated = false;
console.log(e);
}

@@ -909,7 +911,6 @@ _f.Frm.prototype.save = function(save_action, callback, btn) {
if(save_action!="Cancel") {
validated = true;
this.runclientscript('validate');
if(!validated) {
return;
}


+ 4
- 2
public/js/legacy/widgets/form/grid.js View File

@@ -106,10 +106,12 @@ _f.Grid.prototype.insert_column = function(doctype, fieldname, fieldtype, label,
col.doctype = doctype; // for report (fields may be from diff doctypes)
col.fieldname = fieldname;
col.fieldtype = fieldtype;
col.innerHTML = '<div data-grid-fieldname = "'+doctype+'-'+fieldname+'">'+label+'</div>';
$(col).attr("data-grid-fieldname", doctype + "-" + fieldname);
col.innerHTML = label;
col.title = label;
col.label = label;
if(reqd)
col.childNodes[0].style.color = "#D22";
col.style.color = "#D22";
col.style.width = width;
col.options = options;


+ 4
- 6
public/js/legacy/wn/widgets/form/assign_to.js View File

@@ -31,12 +31,10 @@ wn.widgets.form.sidebar.AssignTo = Class.extend({
this.name = docname;
this.wrapper = $a(parent, 'div', 'sidebar-comment-wrapper');
this.body = $a(this.wrapper, 'div');
this.add_btn = $btn($a(this.wrapper, 'div'),
'Assign this document to',
function() {
me.add();
})
this.add_btn = $("<button class='btn btn-small'>\
<i class='icon-plus'></i></button>")
.click(function() { me.add(); }).appendTo(this.wrapper).get(0);
this.refresh();
},
refresh: function() {


+ 12
- 9
public/js/legacy/wn/widgets/form/comments.js View File

@@ -58,14 +58,18 @@ wn.widgets.form.sidebar.Comments = function(parent, sidebar, doctype, docname) {
if(this.wrapper) this.wrapper.innerHTML = '';
else this.wrapper = $a(parent, 'div', 'sidebar-comment-wrapper');

this.input = $a_input(this.wrapper, 'text');
$(this.input).keydown(function(e) {
$("<div class='input-append'><input name='comment' type='text' />\
<button class='btn'><i class='icon-plus'></i></button></div>")
.appendTo(this.wrapper)

$(this.wrapper).find('input').keydown(function(e) {
if(e.which==13) {
$(me.btn).click();
$(me.wrapper).find("button").click();
}
})
this.btn = $btn(this.wrapper, 'Post', function() { me.add_comment() }, {marginLeft:'8px'});

$(this.wrapper).find('button').click(function() {
me.add_comment();
})
this.render_comments()

}
@@ -93,10 +97,9 @@ wn.widgets.form.sidebar.Comments = function(parent, sidebar, doctype, docname) {
}
this.add_comment = function() {
if(!this.input.value) return;
this.btn.set_working();
wn.widgets.form.comments.add(this.input, me.doctype, me.docname, function() {
me.btn.done_working();
var input = $(me.wrapper).find("input").get(0);
if(!input.value) return;
wn.widgets.form.comments.add(input, me.doctype, me.docname, function() {
me.make_body();
me.refresh_latest_comment();
});


+ 2
- 2
public/js/legacy/wn/widgets/form/sidebar.js View File

@@ -95,7 +95,7 @@ wn.widgets.form.sidebar = { Sidebar: function(form) {
display: function() {
return !me.form.doc.__islocal && !me.form.meta.issingle;
},
icon: 'icon-random',
icon: 'icon-link',
onclick: function() {
if(!me.form.linked_with) {
me.form.linked_with = new wn.ui.form.LinkedWith({
@@ -113,7 +113,7 @@ wn.widgets.form.sidebar = { Sidebar: function(form) {
},

{
title: 'Assign To',
title: 'Assign',
render: function(wrapper) {
me.form.assign_to = new wn.widgets.form.sidebar.AssignTo(wrapper, me, me.form.doctype, me.form.docname);
},


+ 2
- 2
public/js/legacy/wn/widgets/page_sidebar.js View File

@@ -105,7 +105,7 @@ wn.widgets.PageSidebarSection = function(sidebar, opts) {
// image
this.add_icon = function(parent, icon) {
var img = $a(parent, 'i', icon, {marginRight: '7px', marginBottom:'-3px'});
var img = $a(parent, 'i', icon, {display:'inline-block', width:'20px'});
}
this.refresh = function() {
@@ -131,7 +131,7 @@ wn.widgets.PageSidebarLink = function(section, opts, wrapper) {
if(opts.icon) {
section.add_icon(this.wrapper, opts.icon);
}
this.ln = $a(this.wrapper, 'span', 'link_type section-link small', opts.style, opts.label);
this.ln = $a(this.wrapper, 'span', 'link_type section-link', opts.style, opts.label);
this.ln.onclick = function() { me.opts.onclick(me) };
}



+ 1
- 1
public/js/wn/form/attachments.js View File

@@ -31,7 +31,7 @@ wn.ui.form.Attachments = Class.extend({
var me = this;
this.wrapper = $('<div>\
<div class="alert-list"></div>\
<button class="btn">Attach</button>\
<button class="btn btn-small"><i class="icon-plus"></i></button>\
</div>').appendTo(this.parent);
this.$list = this.wrapper.find(".alert-list");



+ 4
- 4
public/js/wn/model/doclist.js View File

@@ -51,10 +51,10 @@ wn.model.DocList = Class.extend({
check_name: function() {
var doc = this.doclist[0];
var doctype = doc.doctype;
if(doc.__islocal && (doctype && doctype.autoname
&& doctype.autoname.toLowerCase()=='prompt')) {
var newname = prompt('Enter the name of the new '+ dt, '');
var meta = locals.DocType[doc.doctype];
if(doc.__islocal && (meta && meta.autoname
&& meta.autoname.toLowerCase()=='prompt')) {
var newname = prompt('Enter the name of the new '+ doc.doctype, '');
if(newname) {
doc.__newname = strip(newname);
} else {


Loading…
Cancel
Save