Dotclear

Changeset 3615:b9ac15edad1c


Ignore:
Timestamp:
12/11/17 11:12:57 (8 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Reduce close region of message box as it prevents to copy the content, single error message are not more listed as list but paragraph.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/js/common.js

    r3544 r3615  
    569569          e.preventDefault(); 
    570570          $(this).parent().hide(); 
    571      }); 
    572      $('p.success,p.warning,p.error,div.error').click(function(e) { 
    573          e.preventDefault(); 
    574           $(this).hide(); 
    575571     }); 
    576572 
  • admin/style/default.css

    r3602 r3615  
    15121512  display: flex; 
    15131513  justify-content: space-between; } 
    1514   .close-notice-parent ul { 
     1514  .close-notice-parent ul, .close-notice-parent p + p { 
    15151515    flex: 1; } 
     1516  .close-notice-parent p + p { 
     1517    padding-left: .25em; } 
    15161518 
    15171519.close-notice { 
  • admin/style/scss/partials/_messages.scss

    r3576 r3615  
    100100     display: flex; 
    101101     justify-content: space-between; 
    102      ul { 
     102     ul, p + p { 
    103103          flex: 1; 
     104     } 
     105     p + p { 
     106          padding-left: .25em; 
    104107     } 
    105108} 
  • inc/core/class.dc.error.php

    r3074 r3615  
    3030     /** @var string HTML error item pattern */ 
    3131     protected $html_item = "<li>%s</li>\n"; 
     32     /** @var string HTML error single pattern */ 
     33     protected $html_single = "<p>%s</p>\n"; 
    3234 
    3335     /** 
     
    9496     * @param string     $item          HTML error item pattern 
    9597     */ 
    96      public function setHTMLFormat($list,$item) 
     98     public function setHTMLFormat($list,$item,$single=null) 
    9799     { 
    98100          $this->html_list = $list; 
    99101          $this->html_item = $item; 
     102          if ($single) { 
     103               $this->html_single = $single; 
     104          } 
    100105     } 
    101106 
     
    111116          if ($this->flag) 
    112117          { 
    113                foreach ($this->errors as $msg) 
    114                { 
    115                     $res .= sprintf($this->html_item,$msg); 
     118               if (count($this->errors == 1)) { 
     119                    $res = sprintf($this->html_single,$this->errors[0]); 
     120               } else { 
     121                    foreach ($this->errors as $msg) { 
     122                         $res .= sprintf($this->html_item,$msg); 
     123                    } 
     124                    $res = sprintf($this->html_list,$res); 
    116125               } 
    117  
    118                $res = sprintf($this->html_list,$res); 
    119126          } 
    120127 
Note: See TracChangeset for help on using the changeset viewer.

Sites map